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





def main():

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

  lst = list(map(int, sys.stdin.read().split()))

  set1, setn = set(), set()

  for i, j in zip(lst, lst):

    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


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


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


if __name__ == "__main__":
    main()

+    lst = list(map(int, sys.stdin.read().split())) -    for _ in range(m): -        i, j = list(map(int, sys.stdin.readline().split())) +    for i, j in zip(lst, lst):