from collections import deque

n, m = list(map(int, input().split()))

dat = deque([])

dat_finish = [False] * (n + 1)



for i in range(m):

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

    dat.append((a, b))



for i in range(m):

    a, b = dat[i]

    if b == n:

        dat_finish[a] = True



c = False

for i in range(m):

    a, b = dat[i]

    if a == 1:

        if dat_finish[b]:

            c = True



print(("POSSIBLE" if c else "IMPOSSIBLE"))
from collections import deque

n, m = list(map(int, input().split()))

dat = deque([])

dat2 = deque([])

dat_finish = [False] * (n + 1)



for i in range(m):

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

    dat.append((a, b))

    dat2.append((a, b))



for i in range(m):

    a, b = dat.pop()

    if b == n:

        dat_finish[a] = True



c = False

for i in range(m):

    a, b = dat2.pop()

    if a == 1:

        if dat_finish[b]:

            c = True



print(("POSSIBLE" if c else "IMPOSSIBLE"))

from collections import deque

n, m = list(map(int, input().split()))
dat = deque([])
dat_finish = [False] * (n + 1)
for i in range(m):
    a, b = list(map(int, input().split()))
    dat.append((a, b))
for i in range(m):
    a, b = dat[i]
    if b == n:
        dat_finish[a] = True
c = False
for i in range(m):
    a, b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True
print(("POSSIBLE" if c else "IMPOSSIBLE"))

from collections import deque

n, m = list(map(int, input().split()))
dat = deque([])
dat2 = deque([])
dat_finish = [False] * (n + 1)
for i in range(m):
    a, b = list(map(int, input().split()))
    dat.append((a, b))
    dat2.append((a, b))
for i in range(m):
    a, b = dat.pop()
    if b == n:
        dat_finish[a] = True
c = False
for i in range(m):
    a, b = dat2.pop()
    if a == 1:
        if dat_finish[b]:
            c = True
print(("POSSIBLE" if c else "IMPOSSIBLE"))

+dat2 = deque([]) +    dat2.append((a, b)) -    a, b = dat[i] +    a, b = dat.pop() -    a, b = dat[i] +    a, b = dat2.pop()