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



goto_N = [0]*N

from_1 = [0]*N



for _ in range(M):

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

    if a == 1:

        from_1[b] = 1

    elif b == N:

        goto_N[a] = 1



for i in range(N):

    if goto_N[i] and from_1[i]:

        print("POSSIBLE")

        exit()



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

##1からきている&&Nに行ける



road = [0]*N



for _ in range(M):

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



    if a == 1:

        road[b-1] += 1

    elif b == N:

        road[a-1] += 1



if 2 in road:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")
N, M = list(map(int, input().split()))
goto_N = [0] * N
from_1 = [0] * N
for _ in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        from_1[b] = 1
    elif b == N:
        goto_N[a] = 1
for i in range(N):
    if goto_N[i] and from_1[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
##1からきている&&Nに行ける
road = [0] * N
for _ in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        road[b - 1] += 1
    elif b == N:
        road[a - 1] += 1
if 2 in road:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-goto_N = [0] * N -from_1 = [0] * N +##1からきている&&Nに行ける +road = [0] * N -        from_1[b] = 1 +        road[b - 1] += 1 -        goto_N[a] = 1 -for i in range(N): -    if goto_N[i] and from_1[i]: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +        road[a - 1] += 1 +if 2 in road: +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")