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')

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()

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")

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()

-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") +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()