def solve():

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

    T = {}

    for i in range(M):

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

        if a not in T:

            T[a] = []

        T[a].append(b)

        if b not in T:

            T[b] = []

        T[b].append(a)

    # print(N, M, T)

    FROM_1 = T[1]



    for f in FROM_1:

        if N in T[f]:

            print('POSSIBLE')

            exit()

    print('IMPOSSIBLE')



if __name__ == '__main__':

    solve()

def solve():

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

    FROM_1 = set()

    TO_N = set()

    for i in range(M):

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

        if a == 1:

            FROM_1.add(b)

        elif a == N:

            TO_N.add(b)

        if b == 1:

            FROM_1.add(a)

        elif b == N:

            TO_N.add(a)

    ans = FROM_1 & TO_N

    print('POSSIBLE') if ans else print('IMPOSSIBLE')



if __name__ == '__main__':

    solve()

def solve():
    N, M = list(map(int, input().split()))
    T = {}
    for i in range(M):
        a, b = list(map(int, input().split()))
        if a not in T:
            T[a] = []
        T[a].append(b)
        if b not in T:
            T[b] = []
        T[b].append(a)
    # print(N, M, T)
    FROM_1 = T[1]
    for f in FROM_1:
        if N in T[f]:
            print("POSSIBLE")
            exit()
    print("IMPOSSIBLE")


if __name__ == "__main__":
    solve()

def solve():
    N, M = map(int, input().split())
    FROM_1 = set()
    TO_N = set()
    for i in range(M):
        a, b = map(int, input().split())
        if a == 1:
            FROM_1.add(b)
        elif a == N:
            TO_N.add(b)
        if b == 1:
            FROM_1.add(a)
        elif b == N:
            TO_N.add(a)
    ans = FROM_1 & TO_N
    print("POSSIBLE") if ans else print("IMPOSSIBLE")


if __name__ == "__main__":
    solve()

-    N, M = list(map(int, input().split())) -    T = {} +    N, M = map(int, input().split()) +    FROM_1 = set() +    TO_N = set() -        a, b = list(map(int, input().split())) -        if a not in T: -            T[a] = [] -        T[a].append(b) -        if b not in T: -            T[b] = [] -        T[b].append(a) -    # print(N, M, T) -    FROM_1 = T[1] -    for f in FROM_1: -        if N in T[f]: -            print("POSSIBLE") -            exit() -    print("IMPOSSIBLE") +        a, b = map(int, input().split()) +        if a == 1: +            FROM_1.add(b) +        elif a == N: +            TO_N.add(b) +        if b == 1: +            FROM_1.add(a) +        elif b == N: +            TO_N.add(a) +    ans = FROM_1 & TO_N +    print("POSSIBLE") if ans else print("IMPOSSIBLE")