n, m = list(map(int, input().split()))

ab = []

c = []

for i in range(m):

	a, b = list(map(int, input().split()))

	if a == 1:

		ab.append(b)

	if b == n:

		c.append(a)

if len(set(ab) & set(c)) == 0:

	print ("IMPOSSIBLE")

else:

	print ("POSSIBLE")
n, m = list(map(int, input().split()))

c = [False for i in range(200001)]

d = [False for i in range(200001)]

for i in range(m):

	a, b = list(map(int, input().split()))

	if a == 1:

		c[b] = True

	if b == n:

		d[a] = True

for i in range(200001):

	if c[i] and d[i]:

		print ("POSSIBLE")

		exit()

print ("IMPOSSIBLE")
n, m = list(map(int, input().split()))
ab = []
c = []
for i in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        ab.append(b)
    if b == n:
        c.append(a)
if len(set(ab) & set(c)) == 0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

n, m = list(map(int, input().split()))
c = [False for i in range(200001)]
d = [False for i in range(200001)]
for i in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        c[b] = True
    if b == n:
        d[a] = True
for i in range(200001):
    if c[i] and d[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

-ab = [] -c = [] +c = [False for i in range(200001)] +d = [False for i in range(200001)] -        ab.append(b) +        c[b] = True -        c.append(a) -if len(set(ab) & set(c)) == 0: -    print("IMPOSSIBLE") -else: -    print("POSSIBLE") +        d[a] = True +for i in range(200001): +    if c[i] and d[i]: +        print("POSSIBLE") +        exit() +print("IMPOSSIBLE")