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



graph = [list() for i in range(N+1)]

for i in range(M):

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

    graph[a].append(b)

    graph[b].append(a)



pos_flag = False

for u in graph[1]:

    if N in graph[u]:

        pos_flag = True

        break

if pos_flag == True:

    print("POSSIBLE")

else:

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

graph = [list() for _ in range(N)]



for _ in range(M):

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

    graph[a-1].append(b-1)

    graph[b-1].append(a-1)

    

for g1 in graph[0]:

    if N-1 in graph[g1]:

        print("POSSIBLE")

        break

        

else:

    print("IMPOSSIBLE")
N, M = list(map(int, input().split()))
graph = [list() for i in range(N + 1)]
for i in range(M):
    a, b = tuple(map(int, input().split()))
    graph[a].append(b)
    graph[b].append(a)
pos_flag = False
for u in graph[1]:
    if N in graph[u]:
        pos_flag = True
        break
if pos_flag == True:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
graph = [list() for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
for g1 in graph[0]:
    if N - 1 in graph[g1]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

-graph = [list() for i in range(N + 1)] -for i in range(M): -    a, b = tuple(map(int, input().split())) -    graph[a].append(b) -    graph[b].append(a) -pos_flag = False -for u in graph[1]: -    if N in graph[u]: -        pos_flag = True +graph = [list() for _ in range(N)] +for _ in range(M): +    a, b = list(map(int, input().split())) +    graph[a - 1].append(b - 1) +    graph[b - 1].append(a - 1) +for g1 in graph[0]: +    if N - 1 in graph[g1]: +        print("POSSIBLE") -if pos_flag == True: -    print("POSSIBLE")