def main():

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



  inter, goalable = set(), set()

  for i in range(M):

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

    if a == 1:

      inter.add(b)

    

    if b == N: 

      goalable.add(a)

      

  flag = inter & goalable

  print(("POSSIBLE" if flag else "IMPOSSIBLE"))

  

if __name__ == "__main__":

    main()
def main():

  N, M, *AB = list(map(int, open(0).read().split()))



  inter, goalable = set(), set()

  

  iterator = iter(AB)

  for a, b in zip(iterator, iterator):

    if a == 1:

      inter.add(b)

    

    if b == N: 

      goalable.add(a)

      

  flag = inter & goalable

  print(("POSSIBLE" if flag else "IMPOSSIBLE"))

  

if __name__ == "__main__":

    main()

def main():
    N, M = list(map(int, input().split()))
    inter, goalable = set(), set()
    for i in range(M):
        a, b = list(map(int, input().split()))
        if a == 1:
            inter.add(b)
        if b == N:
            goalable.add(a)
    flag = inter & goalable
    print(("POSSIBLE" if flag else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

def main():
    N, M, *AB = list(map(int, open(0).read().split()))
    inter, goalable = set(), set()
    iterator = iter(AB)
    for a, b in zip(iterator, iterator):
        if a == 1:
            inter.add(b)
        if b == N:
            goalable.add(a)
    flag = inter & goalable
    print(("POSSIBLE" if flag else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

-    N, M = list(map(int, input().split())) +    N, M, *AB = list(map(int, open(0).read().split())) -    for i in range(M): -        a, b = list(map(int, input().split())) +    iterator = iter(AB) +    for a, b in zip(iterator, iterator):