# ARC079C - Cat Snuke and a Voyage (ABC068C)

import sys

input = sys.stdin.readline



def main():

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

    s, d = set(), set()

    for _ in range(m):

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

        if a == 1:

            s.add(b)

        elif b == n:

            d.add(a)

    ans = len(s & d)

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





if __name__ == "__main__":

    main()
# ARC079C - Cat Snuke and a Voyage (ABC068C)

import sys

input = sys.stdin.readline



def main():

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

    s, d = set(), set()

    for _ in range(m):

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

        if a == 1:

            s.add(b)

        elif b == n:

            d.add(a)

    print(("POSSIBLE" if s & d else "IMPOSSIBLE"))





if __name__ == "__main__":

    main()
# ARC079C - Cat Snuke and a Voyage (ABC068C)
import sys

input = sys.stdin.readline


def main():
    n, m = list(map(int, input().rstrip().split()))
    s, d = set(), set()
    for _ in range(m):
        a, b = list(map(int, input().rstrip().split()))
        if a == 1:
            s.add(b)
        elif b == n:
            d.add(a)
    ans = len(s & d)
    print(("POSSIBLE" if ans else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

# ARC079C - Cat Snuke and a Voyage (ABC068C)
import sys

input = sys.stdin.readline


def main():
    n, m = list(map(int, input().rstrip().split()))
    s, d = set(), set()
    for _ in range(m):
        a, b = list(map(int, input().rstrip().split()))
        if a == 1:
            s.add(b)
        elif b == n:
            d.add(a)
    print(("POSSIBLE" if s & d else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

-    ans = len(s & d) -    print(("POSSIBLE" if ans else "IMPOSSIBLE")) +    print(("POSSIBLE" if s & d else "IMPOSSIBLE"))