def Q3(N, M, *arg):

    import numpy as np

    route = np.reshape(np.array(*arg), (M, 2))

    string = 'IMPOSSIBLE'

    p = [False] * N

    q = [False] * N

    for x in route:

        if x[0] == 1:

            p[x[1]] = True

        elif x[1] == N:

            q[x[0]] = True

    for i in range(N):

        if p[i] and q[i]:

            string = 'POSSIBLE'

            break

    return string



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

l = [list([int(x) for x in input().split()]) for i in range(M)]

l = [flatten for inner in l for flatten in inner]

print((Q3(N,M,l)))
def c_cat_snuke_and_a_voyage(N, M, I):

    p = [False] * N  # 島1と島iに辺があるならTrue,なければFalse(0-indexed)

    q = [False] * N  # 島iと島Nに辺があるならTrue,なければFalse(0-indexed)

    for a, b in I:

        if a == 1:  # 出発地が島1なら

            p[b] = True

        elif b == N:  # 目的地が島Nなら

            q[a] = True

    ans = 'IMPOSSIBLE'

    for i in range(N):

        if p[i] and q[i]:

            ans = 'POSSIBLE'

            break  # 1つでもあればいい

    return ans



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

I = [[int(i) for i in input().split()] for j in range(M)]

print((c_cat_snuke_and_a_voyage(N, M, I)))
def Q3(N, M, *arg):
    import numpy as np

    route = np.reshape(np.array(*arg), (M, 2))
    string = "IMPOSSIBLE"
    p = [False] * N
    q = [False] * N
    for x in route:
        if x[0] == 1:
            p[x[1]] = True
        elif x[1] == N:
            q[x[0]] = True
    for i in range(N):
        if p[i] and q[i]:
            string = "POSSIBLE"
            break
    return string


N, M = list(map(int, input().split()))
l = [list([int(x) for x in input().split()]) for i in range(M)]
l = [flatten for inner in l for flatten in inner]
print((Q3(N, M, l)))

def c_cat_snuke_and_a_voyage(N, M, I):
    p = [False] * N  # 島1と島iに辺があるならTrue,なければFalse(0-indexed)
    q = [False] * N  # 島iと島Nに辺があるならTrue,なければFalse(0-indexed)
    for a, b in I:
        if a == 1:  # 出発地が島1なら
            p[b] = True
        elif b == N:  # 目的地が島Nなら
            q[a] = True
    ans = "IMPOSSIBLE"
    for i in range(N):
        if p[i] and q[i]:
            ans = "POSSIBLE"
            break  # 1つでもあればいい
    return ans


N, M = [int(i) for i in input().split()]
I = [[int(i) for i in input().split()] for j in range(M)]
print((c_cat_snuke_and_a_voyage(N, M, I)))

-def Q3(N, M, *arg): -    import numpy as np - -    route = np.reshape(np.array(*arg), (M, 2)) -    string = "IMPOSSIBLE" -    p = [False] * N -    q = [False] * N -    for x in route: -        if x[0] == 1: -            p[x[1]] = True -        elif x[1] == N: -            q[x[0]] = True +def c_cat_snuke_and_a_voyage(N, M, I): +    p = [False] * N  # 島1と島iに辺があるならTrue,なければFalse(0-indexed) +    q = [False] * N  # 島iと島Nに辺があるならTrue,なければFalse(0-indexed) +    for a, b in I: +        if a == 1:  # 出発地が島1なら +            p[b] = True +        elif b == N:  # 目的地が島Nなら +            q[a] = True +    ans = "IMPOSSIBLE" -            string = "POSSIBLE" -            break -    return string +            ans = "POSSIBLE" +            break  # 1つでもあればいい +    return ans -N, M = list(map(int, input().split())) -l = [list([int(x) for x in input().split()]) for i in range(M)] -l = [flatten for inner in l for flatten in inner] -print((Q3(N, M, l))) +N, M = [int(i) for i in input().split()] +I = [[int(i) for i in input().split()] for j in range(M)] +print((c_cat_snuke_and_a_voyage(N, M, I)))