N,M = list(map(int,input().split()))

a = [list(map(int,input().split())) for i in range(M)]

b = set()

for i in a:

    if i[0]==1 or i[1]==N:

        b.add((i[0],i[1]))

for i in range(2,N):

    if (1,i) in b and (i,N) in b:

    	print('POSSIBLE')

    	exit()

print('IMPOSSIBLE')

N, M = list(map(int,input().split()))

t_mid = set()

f_mid = set()

for _ in range(M):

    f, t = list(map(int,input().split()))

    if f == 1:

        t_mid.add(t)

    elif t == N:

        f_mid.add(f)



if t_mid & f_mid:

    print('POSSIBLE')

else:

    print('IMPOSSIBLE')

N, M = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(M)]
b = set()
for i in a:
    if i[0] == 1 or i[1] == N:
        b.add((i[0], i[1]))
for i in range(2, N):
    if (1, i) in b and (i, N) in b:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
t_mid = set()
f_mid = set()
for _ in range(M):
    f, t = list(map(int, input().split()))
    if f == 1:
        t_mid.add(t)
    elif t == N:
        f_mid.add(f)
if t_mid & f_mid:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-a = [list(map(int, input().split())) for i in range(M)] -b = set() -for i in a: -    if i[0] == 1 or i[1] == N: -        b.add((i[0], i[1])) -for i in range(2, N): -    if (1, i) in b and (i, N) in b: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +t_mid = set() +f_mid = set() +for _ in range(M): +    f, t = list(map(int, input().split())) +    if f == 1: +        t_mid.add(t) +    elif t == N: +        f_mid.add(f) +if t_mid & f_mid: +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")