import sys

import collections





input = sys.stdin.readline





def main():

    N, M = [int(x) for x in input().split()]

    ab = [[] for j in range(N + 1)]

    distance = [0] * (N + 1)

    for _ in range(M):

        a, b = [int(x) for x in input().split()]

        ab[a].append(b)

        ab[b].append(a)



    q = collections.deque()

    q.append([1, 0])



    visited = set()

    visited.add(1)



    while q:

        c, d = q.popleft()



        for n in ab[c]:

            if n not in visited:

                visited.add(n)

                q.append([n, d + 1])

                distance[n] = d + 1



    if distance[N] != 0 and distance[N] <=2:

        print("POSSIBLE")

    else:

        print("IMPOSSIBLE")









    

    

    



if __name__ == '__main__':

    main()



N, M = [int(x) for x in input().split()]

AB = [[int(x) for x in input().split()] for _ in range(M)]





x = set()

for a, b in AB:

    if a == 1:

        x.add(b)

    if b == 1:

        x.add(a)



f = False



for a, b in AB:

    if (a in x and b == N) or (b in x and a == N):

        f = True



if f:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")

import sys
import collections

input = sys.stdin.readline


def main():
    N, M = [int(x) for x in input().split()]
    ab = [[] for j in range(N + 1)]
    distance = [0] * (N + 1)
    for _ in range(M):
        a, b = [int(x) for x in input().split()]
        ab[a].append(b)
        ab[b].append(a)
    q = collections.deque()
    q.append([1, 0])
    visited = set()
    visited.add(1)
    while q:
        c, d = q.popleft()
        for n in ab[c]:
            if n not in visited:
                visited.add(n)
                q.append([n, d + 1])
                distance[n] = d + 1
    if distance[N] != 0 and distance[N] <= 2:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

N, M = [int(x) for x in input().split()]
AB = [[int(x) for x in input().split()] for _ in range(M)]
x = set()
for a, b in AB:
    if a == 1:
        x.add(b)
    if b == 1:
        x.add(a)
f = False
for a, b in AB:
    if (a in x and b == N) or (b in x and a == N):
        f = True
if f:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-import sys -import collections - -input = sys.stdin.readline - - -def main(): -    N, M = [int(x) for x in input().split()] -    ab = [[] for j in range(N + 1)] -    distance = [0] * (N + 1) -    for _ in range(M): -        a, b = [int(x) for x in input().split()] -        ab[a].append(b) -        ab[b].append(a) -    q = collections.deque() -    q.append([1, 0]) -    visited = set() -    visited.add(1) -    while q: -        c, d = q.popleft() -        for n in ab[c]: -            if n not in visited: -                visited.add(n) -                q.append([n, d + 1]) -                distance[n] = d + 1 -    if distance[N] != 0 and distance[N] <= 2: -        print("POSSIBLE") -    else: -        print("IMPOSSIBLE") - - -if __name__ == "__main__": -    main() +N, M = [int(x) for x in input().split()] +AB = [[int(x) for x in input().split()] for _ in range(M)] +x = set() +for a, b in AB: +    if a == 1: +        x.add(b) +    if b == 1: +        x.add(a) +f = False +for a, b in AB: +    if (a in x and b == N) or (b in x and a == N): +        f = True +if f: +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")