import sys



input = sys.stdin.readline



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

m = set()



for _ in range(M):

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

    if a < b:

        m.add((a,b))

    else:

        m.add((b,a))





for i in range(2, N):

    if (1, i) in m and (i, N) in m:

        print("POSSIBLE")

        break

else:

    print("IMPOSSIBLE")



import sys



input = sys.stdin.readline



def main():

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

    m = set()

    for _ in range(M):

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

        if a < b:

            m.add((a,b))

        else:

            m.add((b,a))

    for i in range(2, N):

        if (1, i) in m and (i, N) in m:

            print("POSSIBLE")

            break

    else:

        print("IMPOSSIBLE")

main()
import sys

input = sys.stdin.readline
N, M = list(map(int, input().split(" ")))
m = set()
for _ in range(M):
    a, b = list(map(int, input().split(" ")))
    if a < b:
        m.add((a, b))
    else:
        m.add((b, a))
for i in range(2, N):
    if (1, i) in m and (i, N) in m:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

import sys

input = sys.stdin.readline


def main():
    N, M = list(map(int, input().split(" ")))
    m = set()
    for _ in range(M):
        a, b = list(map(int, input().split(" ")))
        if a < b:
            m.add((a, b))
        else:
            m.add((b, a))
    for i in range(2, N):
        if (1, i) in m and (i, N) in m:
            print("POSSIBLE")
            break
    else:
        print("IMPOSSIBLE")


main()

-N, M = list(map(int, input().split(" "))) -m = set() -for _ in range(M): -    a, b = list(map(int, input().split(" "))) -    if a < b: -        m.add((a, b)) + + +def main(): +    N, M = list(map(int, input().split(" "))) +    m = set() +    for _ in range(M): +        a, b = list(map(int, input().split(" "))) +        if a < b: +            m.add((a, b)) +        else: +            m.add((b, a)) +    for i in range(2, N): +        if (1, i) in m and (i, N) in m: +            print("POSSIBLE") +            break -        m.add((b, a)) -for i in range(2, N): -    if (1, i) in m and (i, N) in m: -        print("POSSIBLE") -        break -else: -    print("IMPOSSIBLE") +        print("IMPOSSIBLE") + + +main()