import heapq

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

ab = [list(map(int, input().split())) for _ in range(m)]

ab.sort()

ls = []

heapq.heapify(ls)

for i in range(m):

    if ab[i][0] == 1:

        heapq.heappush(ls, ab[i][1])

    else:

        while True:

            if len(ls) != 0:

                p = heapq.heappop(ls)

                if p == ab[i][0]:

                    if ab[i][1] == n:

                        print("POSSIBLE")

                        exit()

                    else:

                        heapq.heappush(ls, p)

                        break

                elif p > ab[i][0]:

                    heapq.heappush(ls, p)

                    break

            else:

                print("IMPOSSIBLE")

                exit()

print("IMPOSSIBLE")

def slove():

    import sys

    import collections

    input = sys.stdin.readline

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

    s = collections.defaultdict(list)

    e = collections.defaultdict(list)

    for i in range(m):

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

        if a == 1:

            s[b]

        if b == 1:

            s[a]

        if a == n:

            e[b]

        if b == n:

            e[a]

    for v in list(s.keys()):

        if v in e:

            print("POSSIBLE")

            exit()

    print("IMPOSSIBLE")







if __name__ == '__main__':

    slove()

import heapq

n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
ab.sort()
ls = []
heapq.heapify(ls)
for i in range(m):
    if ab[i][0] == 1:
        heapq.heappush(ls, ab[i][1])
    else:
        while True:
            if len(ls) != 0:
                p = heapq.heappop(ls)
                if p == ab[i][0]:
                    if ab[i][1] == n:
                        print("POSSIBLE")
                        exit()
                    else:
                        heapq.heappush(ls, p)
                        break
                elif p > ab[i][0]:
                    heapq.heappush(ls, p)
                    break
            else:
                print("IMPOSSIBLE")
                exit()
print("IMPOSSIBLE")

def slove():
    import sys
    import collections

    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip("\n").split()))
    s = collections.defaultdict(list)
    e = collections.defaultdict(list)
    for i in range(m):
        a, b = list(map(int, input().rstrip("\n").split()))
        if a == 1:
            s[b]
        if b == 1:
            s[a]
        if a == n:
            e[b]
        if b == n:
            e[a]
    for v in list(s.keys()):
        if v in e:
            print("POSSIBLE")
            exit()
    print("IMPOSSIBLE")


if __name__ == "__main__":
    slove()

-import heapq +def slove(): +    import sys +    import collections -n, m = list(map(int, input().split())) -ab = [list(map(int, input().split())) for _ in range(m)] -ab.sort() -ls = [] -heapq.heapify(ls) -for i in range(m): -    if ab[i][0] == 1: -        heapq.heappush(ls, ab[i][1]) -    else: -        while True: -            if len(ls) != 0: -                p = heapq.heappop(ls) -                if p == ab[i][0]: -                    if ab[i][1] == n: -                        print("POSSIBLE") -                        exit() -                    else: -                        heapq.heappush(ls, p) -                        break -                elif p > ab[i][0]: -                    heapq.heappush(ls, p) -                    break -            else: -                print("IMPOSSIBLE") -                exit() -print("IMPOSSIBLE") +    input = sys.stdin.readline +    n, m = list(map(int, input().rstrip("\n").split())) +    s = collections.defaultdict(list) +    e = collections.defaultdict(list) +    for i in range(m): +        a, b = list(map(int, input().rstrip("\n").split())) +        if a == 1: +            s[b] +        if b == 1: +            s[a] +        if a == n: +            e[b] +        if b == n: +            e[a] +    for v in list(s.keys()): +        if v in e: +            print("POSSIBLE") +            exit() +    print("IMPOSSIBLE") + + +if __name__ == "__main__": +    slove()