# ABC068C - Cat Snuke and a Voyage (ARC079C)

import sys

input = sys.stdin.readline



def main():

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

    s, d = set(), set()  # start, destination

    for _ in range(m):

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

        if a == 1:

            s.add(b)  # 1 to X

        elif b == n:

            d.add(a)  # X to n

    # if the same X in both s & d -> possible

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





if __name__ == "__main__":

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

def main():

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

    from_1, to_N = set(), set()

    for a, b in zip(*[iter(AB)] * 2):

        if a == 1:

            from_1.add(b)

        if b == N:

            to_N.add(a)

    flg = from_1 & to_N  # intermediate point of both 1, N exists?

    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 = list(map(int, input().split()))
    s, d = set(), set()  # start, destination
    for _ in range(m):
        a, b = list(map(int, input().split()))
        if a == 1:
            s.add(b)  # 1 to X
        elif b == n:
            d.add(a)  # X to n
    # if the same X in both s & d -> possible
    print(("POSSIBLE" if s & d else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

# ABC068C - Cat Snuke and a Voyage (ARC079C)
def main():
    N, M, *AB = list(map(int, open(0).read().split()))
    from_1, to_N = set(), set()
    for a, b in zip(*[iter(AB)] * 2):
        if a == 1:
            from_1.add(b)
        if b == N:
            to_N.add(a)
    flg = from_1 & to_N  # intermediate point of both 1, N exists?
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

-import sys - -input = sys.stdin.readline - - -    n, m = list(map(int, input().split())) -    s, d = set(), set()  # start, destination -    for _ in range(m): -        a, b = list(map(int, input().split())) +    N, M, *AB = list(map(int, open(0).read().split())) +    from_1, to_N = set(), set() +    for a, b in zip(*[iter(AB)] * 2): -            s.add(b)  # 1 to X -        elif b == n: -            d.add(a)  # X to n -    # if the same X in both s & d -> possible -    print(("POSSIBLE" if s & d else "IMPOSSIBLE")) +            from_1.add(b) +        if b == N: +            to_N.add(a) +    flg = from_1 & to_N  # intermediate point of both 1, N exists? +    print(("POSSIBLE" if flg else "IMPOSSIBLE"))