import sys

n, m = list(map(int, sys.stdin.readline().split()))

set1, setn = set(), set()

for _ in range(m):

  i, j = list(map(int, sys.stdin.readline().split()))

  if i in [1, n] or j in [1, n]:

    if i == 1:

      set1.add(j)

    if i == n:

      setn.add(j)

    if j == 1:

      set1.add(i)

    if j == n:

      setn.add(i)

if set1 & setn:

  print('POSSIBLE')

else:

  print('IMPOSSIBLE')

import sys





def main():

  n, m = list(map(int, sys.stdin.readline().split()))

  set1, setn = set(), set()

  for _ in range(m):

    i, j = list(map(int, sys.stdin.readline().split()))

    if i == 1:

      set1.add(j)

    if j == n:

      setn.add(i)

  if set1 & setn:

    print('POSSIBLE')

  else:

    print('IMPOSSIBLE')





if __name__ == '__main__':

  main()
import sys

n, m = list(map(int, sys.stdin.readline().split()))
set1, setn = set(), set()
for _ in range(m):
    i, j = list(map(int, sys.stdin.readline().split()))
    if i in [1, n] or j in [1, n]:
        if i == 1:
            set1.add(j)
        if i == n:
            setn.add(j)
        if j == 1:
            set1.add(i)
        if j == n:
            setn.add(i)
if set1 & setn:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import sys


def main():
    n, m = list(map(int, sys.stdin.readline().split()))
    set1, setn = set(), set()
    for _ in range(m):
        i, j = list(map(int, sys.stdin.readline().split()))
        if i == 1:
            set1.add(j)
        if j == n:
            setn.add(i)
    if set1 & setn:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

-n, m = list(map(int, sys.stdin.readline().split())) -set1, setn = set(), set() -for _ in range(m): -    i, j = list(map(int, sys.stdin.readline().split())) -    if i in [1, n] or j in [1, n]: + +def main(): +    n, m = list(map(int, sys.stdin.readline().split())) +    set1, setn = set(), set() +    for _ in range(m): +        i, j = list(map(int, sys.stdin.readline().split())) -        if i == n: -            setn.add(j) -        if j == 1: -            set1.add(i) -if set1 & setn: -    print("POSSIBLE") -else: -    print("IMPOSSIBLE") +    if set1 & setn: +        print("POSSIBLE") +    else: +        print("IMPOSSIBLE") + + +if __name__ == "__main__": +    main()