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

ship = []

flag = False

for i in range(n):

  ship.append([])



for i in range(m):

  temp = list(map(int, input().split()))

  ship[temp[0]-1].append(temp)



for i in range(len(ship[0])):

  now = ship[0][i]

  if [now[1], n] in ship[now[1]-1]:

    flag = True

    break



if flag:

  print('POSSIBLE')

else:

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

l = []

for i in range(200001):

  l.append([])



for i in range(m):

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

  l[a].append(b)

def f():

  for i in l[1]:

    if n in l[i]:

      return 'POSSIBLE'

  

  return 'IMPOSSIBLE'

print((f()))
n, m = list(map(int, input().split()))
ship = []
flag = False
for i in range(n):
    ship.append([])
for i in range(m):
    temp = list(map(int, input().split()))
    ship[temp[0] - 1].append(temp)
for i in range(len(ship[0])):
    now = ship[0][i]
    if [now[1], n] in ship[now[1] - 1]:
        flag = True
        break
if flag:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
l = []
for i in range(200001):
    l.append([])
for i in range(m):
    a, b = list(map(int, input().split()))
    l[a].append(b)


def f():
    for i in l[1]:
        if n in l[i]:
            return "POSSIBLE"
    return "IMPOSSIBLE"


print((f()))

-ship = [] -flag = False -for i in range(n): -    ship.append([]) +l = [] +for i in range(200001): +    l.append([]) -    temp = list(map(int, input().split())) -    ship[temp[0] - 1].append(temp) -for i in range(len(ship[0])): -    now = ship[0][i] -    if [now[1], n] in ship[now[1] - 1]: -        flag = True -        break -if flag: -    print("POSSIBLE") -else: -    print("IMPOSSIBLE") +    a, b = list(map(int, input().split())) +    l[a].append(b) + + +def f(): +    for i in l[1]: +        if n in l[i]: +            return "POSSIBLE" +    return "IMPOSSIBLE" + + +print((f()))