import sys

from collections import defaultdict





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



inter = []

goalable = defaultdict(lambda: False)

for i in range(M):

  start, end = list(map(int, input().split()))

  if start == 1:

    inter.append(end)

  else:

    if end == N: 

      goalable[start] = True

      

for i in inter:

  if goalable[i]:

    print("POSSIBLE")

    sys.exit()

    

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



inter, goalable = set(), set()

for i in range(M):

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

  if a == 1:

    inter.add(b)

    

  if b == N: 

    goalable.add(a)

      

flag = inter & goalable

print(("POSSIBLE" if flag else "IMPOSSIBLE"))
import sys
from collections import defaultdict

N, M = list(map(int, input().split()))
inter = []
goalable = defaultdict(lambda: False)
for i in range(M):
    start, end = list(map(int, input().split()))
    if start == 1:
        inter.append(end)
    else:
        if end == N:
            goalable[start] = True
for i in inter:
    if goalable[i]:
        print("POSSIBLE")
        sys.exit()
print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
inter, goalable = set(), set()
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        inter.add(b)
    if b == N:
        goalable.add(a)
flag = inter & goalable
print(("POSSIBLE" if flag else "IMPOSSIBLE"))

-import sys -from collections import defaultdict - -inter = [] -goalable = defaultdict(lambda: False) +inter, goalable = set(), set() -    start, end = list(map(int, input().split())) -    if start == 1: -        inter.append(end) -    else: -        if end == N: -            goalable[start] = True -for i in inter: -    if goalable[i]: -        print("POSSIBLE") -        sys.exit() -print("IMPOSSIBLE") +    a, b = list(map(int, input().split())) +    if a == 1: +        inter.add(b) +    if b == N: +        goalable.add(a) +flag = inter & goalable +print(("POSSIBLE" if flag else "IMPOSSIBLE"))