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

a=[0]*n

b=[0]*n

for i in range(m):

  c,d=list(map(int,input().split()))

  if c==1:

    a[d-1]=1

  if d==n:

    b[c-1]=1

success=0

for i in range(1,n):

  if a[i]*b[i]==1:

    success=1

if success==1:

  print('POSSIBLE')

else:

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

a=[0]*(n+1)

b=[0]*(n+1)

for i in range(m):

  x,y=list(map(int,input().split()))

  if x==1:

    a[y]=1

  if y==n:

    b[x]=1

ans=0

for i in range(n+1):

  ans+=a[i]*b[i]

if ans==0:

  print('IMPOSSIBLE')

else:

  print('POSSIBLE')
n, m = list(map(int, input().split()))
a = [0] * n
b = [0] * n
for i in range(m):
    c, d = list(map(int, input().split()))
    if c == 1:
        a[d - 1] = 1
    if d == n:
        b[c - 1] = 1
success = 0
for i in range(1, n):
    if a[i] * b[i] == 1:
        success = 1
if success == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
a = [0] * (n + 1)
b = [0] * (n + 1)
for i in range(m):
    x, y = list(map(int, input().split()))
    if x == 1:
        a[y] = 1
    if y == n:
        b[x] = 1
ans = 0
for i in range(n + 1):
    ans += a[i] * b[i]
if ans == 0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

-a = [0] * n -b = [0] * n +a = [0] * (n + 1) +b = [0] * (n + 1) -    c, d = list(map(int, input().split())) -    if c == 1: -        a[d - 1] = 1 -    if d == n: -        b[c - 1] = 1 -success = 0 -for i in range(1, n): -    if a[i] * b[i] == 1: -        success = 1 -if success == 1: +    x, y = list(map(int, input().split())) +    if x == 1: +        a[y] = 1 +    if y == n: +        b[x] = 1 +ans = 0 +for i in range(n + 1): +    ans += a[i] * b[i] +if ans == 0: +    print("IMPOSSIBLE") +else: -else: -    print("IMPOSSIBLE")