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

g=[[] for _ in range(n+1)]

for i in range(m):

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

  g[a].append(b)

  g[b].append(a)

flag=False

for i in g[1]:

  for j in g[i]:

    if j==n:

      flag=True

if flag==True:

  print('POSSIBLE')

else:

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

s1=set()

s2=set()

for _ in range(m):

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

  if a==1:

    s1.add(b)

  if b==n:

    s2.add(a)

if len(s1&s2)!=0:

  print('POSSIBLE')

else:

  print('IMPOSSIBLE')
n, m = list(map(int, input().split()))
g = [[] for _ in range(n + 1)]
for i in range(m):
    a, b = list(map(int, input().split()))
    g[a].append(b)
    g[b].append(a)
flag = False
for i in g[1]:
    for j in g[i]:
        if j == n:
            flag = True
if flag == True:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
s1 = set()
s2 = set()
for _ in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        s1.add(b)
    if b == n:
        s2.add(a)
if len(s1 & s2) != 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-g = [[] for _ in range(n + 1)] -for i in range(m): +s1 = set() +s2 = set() +for _ in range(m): -    g[a].append(b) -    g[b].append(a) -flag = False -for i in g[1]: -    for j in g[i]: -        if j == n: -            flag = True -if flag == True: +    if a == 1: +        s1.add(b) +    if b == n: +        s2.add(a) +if len(s1 & s2) != 0: