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



first = []

second = []

for i in range(m):

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

    if a[0] == 1:

        first.append(a[1])

    if a[1] == n:

        second.append(a[0])





if len(set(first) & set(second)) > 0:

    print('POSSIBLE')

else:

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

a = []

b = []



for i in range(m):

    x, y = list(map(int, input().split()))

    if x == 1:

        a.append(y)

    elif y == n:

        b.append(x)



if set(a) & set(b):

    print('POSSIBLE')

else:

    print('IMPOSSIBLE')

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

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

-first = [] -second = [] +a = [] +b = [] -    a = list(map(int, input().split())) -    if a[0] == 1: -        first.append(a[1]) -    if a[1] == n: -        second.append(a[0]) -if len(set(first) & set(second)) > 0: +    x, y = list(map(int, input().split())) +    if x == 1: +        a.append(y) +    elif y == n: +        b.append(x) +if set(a) & set(b):