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

AB = [tuple(map(int, input().split())) for _ in range(m)]



C, D = set(), set()

for a, b in AB:

  if a == 1:

    C.add(b)

  elif b == n:

    D.add(a)



if len(C & D):

  print('POSSIBLE')

else:

  print('IMPOSSIBLE')
n, m, *AB = list(map(int, open(0).read().split()))



C, D = set(), set()

for a, b in zip(AB[::2], AB[1::2]):

  if a == 1:

    C.add(b)

  if b == n:

    D.add(a)



if len(C & D):

  print('POSSIBLE')

else:

  print('IMPOSSIBLE')
n, m = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for _ in range(m)]
C, D = set(), set()
for a, b in AB:
    if a == 1:
        C.add(b)
    elif b == n:
        D.add(a)
if len(C & D):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

n, m, *AB = list(map(int, open(0).read().split()))
C, D = set(), set()
for a, b in zip(AB[::2], AB[1::2]):
    if a == 1:
        C.add(b)
    if b == n:
        D.add(a)
if len(C & D):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-n, m = list(map(int, input().split())) -AB = [tuple(map(int, input().split())) for _ in range(m)] +n, m, *AB = list(map(int, open(0).read().split())) -for a, b in AB: +for a, b in zip(AB[::2], AB[1::2]): -    elif b == n: +    if b == n: