# ABC068C - Cat Snuke and a Voyage (ARC079C)

def main():

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

    A = tuple(tuple(map(int, input().split())) for _ in range(M))

    S, D = set(), set()  # start, destination

    for a, b in A:

        if a == 1:

            S |= {b}

        if b == N:

            D |= {a}

    flg = S & D  # if the same X in both S & D -> possible

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





if __name__ == "__main__":

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

import sys

input = sys.stdin.readline



def main():

    N, M = input().split()

    A = tuple(input().split() for _ in range(int(M)))

    S, D = set(), set()  # start, destination

    for a, b in A:

        if a == "1":

            S |= {b}

        if b == N:

            D |= {a}

    flg = S & D  # if the same X in both S & D -> possible

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





if __name__ == "__main__":

    main()
# ABC068C - Cat Snuke and a Voyage (ARC079C)
def main():
    N, M = tuple(map(int, input().split()))
    A = tuple(tuple(map(int, input().split())) for _ in range(M))
    S, D = set(), set()  # start, destination
    for a, b in A:
        if a == 1:
            S |= {b}
        if b == N:
            D |= {a}
    flg = S & D  # if the same X in both S & D -> possible
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

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

input = sys.stdin.readline


def main():
    N, M = input().split()
    A = tuple(input().split() for _ in range(int(M)))
    S, D = set(), set()  # start, destination
    for a, b in A:
        if a == "1":
            S |= {b}
        if b == N:
            D |= {a}
    flg = S & D  # if the same X in both S & D -> possible
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

+import sys + +input = sys.stdin.readline + + -    N, M = tuple(map(int, input().split())) -    A = tuple(tuple(map(int, input().split())) for _ in range(M)) +    N, M = input().split() +    A = tuple(input().split() for _ in range(int(M))) -        if a == 1: +        if a == "1":