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

ship1 = set([])

ship2 = set([])

for i in range(M):

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

    if a == 1:

        ship1.add(b)

    elif b == N:

        ship2.add(a)



if len(ship1 & ship2) == 0:

    print('IMPOSSIBLE')

else:

    print('POSSIBLE')
import sys

input = sys.stdin.readline



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

ship1 = set([])

ship2 = set([])

for i in range(M):

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

    if a == 1:

        ship1.add(b)

    elif b == N:

        ship2.add(a)



if ship1 & ship2:

    print('POSSIBLE')

else:

    print('IMPOSSIBLE')
N, M = list(map(int, input().split()))
ship1 = set([])
ship2 = set([])
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        ship1.add(b)
    elif b == N:
        ship2.add(a)
if len(ship1 & ship2) == 0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
ship1 = set([])
ship2 = set([])
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        ship1.add(b)
    elif b == N:
        ship2.add(a)
if ship1 & ship2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

+import sys + +input = sys.stdin.readline -if len(ship1 & ship2) == 0: +if ship1 & ship2: +    print("POSSIBLE") +else: -else: -    print("POSSIBLE")