def main():

    from collections import deque

    N, M = (int(i) for i in input().split())

    G = [[] for i in range(N+1)]

    G_color = ['WHITE' for _ in range(N+1)]

    G_distance = [float('inf') for _ in range(N+1)]

    for i in range(M):

        a, b = (int(i) for i in input().split())

        G[a].append(b)

        G[b].append(a)



    def bfs(s):

        """

        G_color: BLACK if visited, GRAY if discovered, but will visit, WHITE

                 if not discovered

        G_distance: a distance from s to v when algorithm computed

        """

        G_color[s] = 'GRAY'

        G_distance[s] = 0

        Q = deque()

        Q.append(s)

        while Q:

            u = Q.popleft()

            for v in G[u]:

                if G_color[v] == 'WHITE':

                    G_color[v] = 'GRAY'

                    G_distance[v] = G_distance[u] + 1

                    Q.append(v)

                    # distance <= 2 が探索し終わったら終わり

                    if G_distance[v] == 3:

                        return None

            G_color[u] = 'BLACK'

    bfs(1)

    if G_color[N] != 'WHITE' and G_distance[N] <= 2:

        print("POSSIBLE")

    else:

        print("IMPOSSIBLE")





if __name__ == '__main__':

    main()

def main():

    import sys

    input = sys.stdin.buffer.readline

    N, M = (int(i) for i in input().split())

    edge = [[] for _ in range(N)]

    for i in range(M):

        a, b = (int(i) for i in input().split())

        edge[a-1].append((1, b-1))

        edge[b-1].append((1, a-1))

    from heapq import heappop, heappush



    def dijkstra(G, s):

        d = [10**12]*N

        used = [True] * N  # True:未確定

        d[s] = 0

        used[s] = False

        edges = []

        for e in G[s]:

            heappush(edges, e)

        while len(edges):

            c, v = heappop(edges)

            if not used[v]:

                continue

            d[v] = c

            used[v] = False

            for nexc, nexv in G[v]:

                if used[nexv]:

                    heappush(edges, (nexc+c, nexv))

        return d



    dist = dijkstra(edge, 0)

    if dist[N-1] <= 2:

        print("POSSIBLE")

    else:

        print("IMPOSSIBLE")





if __name__ == '__main__':

    main()

def main():
    from collections import deque

    N, M = (int(i) for i in input().split())
    G = [[] for i in range(N + 1)]
    G_color = ["WHITE" for _ in range(N + 1)]
    G_distance = [float("inf") for _ in range(N + 1)]
    for i in range(M):
        a, b = (int(i) for i in input().split())
        G[a].append(b)
        G[b].append(a)

    def bfs(s):
        """
        G_color: BLACK if visited, GRAY if discovered, but will visit, WHITE
                 if not discovered
        G_distance: a distance from s to v when algorithm computed
        """
        G_color[s] = "GRAY"
        G_distance[s] = 0
        Q = deque()
        Q.append(s)
        while Q:
            u = Q.popleft()
            for v in G[u]:
                if G_color[v] == "WHITE":
                    G_color[v] = "GRAY"
                    G_distance[v] = G_distance[u] + 1
                    Q.append(v)
                    # distance <= 2 が探索し終わったら終わり
                    if G_distance[v] == 3:
                        return None
            G_color[u] = "BLACK"

    bfs(1)
    if G_color[N] != "WHITE" and G_distance[N] <= 2:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.buffer.readline
    N, M = (int(i) for i in input().split())
    edge = [[] for _ in range(N)]
    for i in range(M):
        a, b = (int(i) for i in input().split())
        edge[a - 1].append((1, b - 1))
        edge[b - 1].append((1, a - 1))
    from heapq import heappop, heappush

    def dijkstra(G, s):
        d = [10**12] * N
        used = [True] * N  # True:未確定
        d[s] = 0
        used[s] = False
        edges = []
        for e in G[s]:
            heappush(edges, e)
        while len(edges):
            c, v = heappop(edges)
            if not used[v]:
                continue
            d[v] = c
            used[v] = False
            for nexc, nexv in G[v]:
                if used[nexv]:
                    heappush(edges, (nexc + c, nexv))
        return d

    dist = dijkstra(edge, 0)
    if dist[N - 1] <= 2:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

-    from collections import deque +    import sys +    input = sys.stdin.buffer.readline -    G = [[] for i in range(N + 1)] -    G_color = ["WHITE" for _ in range(N + 1)] -    G_distance = [float("inf") for _ in range(N + 1)] +    edge = [[] for _ in range(N)] -        G[a].append(b) -        G[b].append(a) +        edge[a - 1].append((1, b - 1)) +        edge[b - 1].append((1, a - 1)) +    from heapq import heappop, heappush -    def bfs(s): -        """ -        G_color: BLACK if visited, GRAY if discovered, but will visit, WHITE -                 if not discovered -        G_distance: a distance from s to v when algorithm computed -        """ -        G_color[s] = "GRAY" -        G_distance[s] = 0 -        Q = deque() -        Q.append(s) -        while Q: -            u = Q.popleft() -            for v in G[u]: -                if G_color[v] == "WHITE": -                    G_color[v] = "GRAY" -                    G_distance[v] = G_distance[u] + 1 -                    Q.append(v) -                    # distance <= 2 が探索し終わったら終わり -                    if G_distance[v] == 3: -                        return None -            G_color[u] = "BLACK" +    def dijkstra(G, s): +        d = [10**12] * N +        used = [True] * N  # True:未確定 +        d[s] = 0 +        used[s] = False +        edges = [] +        for e in G[s]: +            heappush(edges, e) +        while len(edges): +            c, v = heappop(edges) +            if not used[v]: +                continue +            d[v] = c +            used[v] = False +            for nexc, nexv in G[v]: +                if used[nexv]: +                    heappush(edges, (nexc + c, nexv)) +        return d -    bfs(1) -    if G_color[N] != "WHITE" and G_distance[N] <= 2: +    dist = dijkstra(edge, 0) +    if dist[N - 1] <= 2: