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

dic = {}

for i in range(1, n+1):

  dic[i] = []

for i in range(m):

  a1, a2 = list(map(int, input().split()))

  dic[a1] += [a2]

  dic[a2] += [a1]



Places_from1 = dic[1]

for place in Places_from1:

  if n in dic[place]:

    print("POSSIBLE")

    break

else:

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

sa=set()

sb=set()

for i in range(M):

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

    if a==1:sb.add(b)

    if b==N:sa.add(a)

print(("IMPOSSIBLE" if len(sa&sb)==0 else "POSSIBLE"))
n, m = list(map(int, input().split()))
dic = {}
for i in range(1, n + 1):
    dic[i] = []
for i in range(m):
    a1, a2 = list(map(int, input().split()))
    dic[a1] += [a2]
    dic[a2] += [a1]
Places_from1 = dic[1]
for place in Places_from1:
    if n in dic[place]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

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

-n, m = list(map(int, input().split())) -dic = {} -for i in range(1, n + 1): -    dic[i] = [] -for i in range(m): -    a1, a2 = list(map(int, input().split())) -    dic[a1] += [a2] -    dic[a2] += [a1] -Places_from1 = dic[1] -for place in Places_from1: -    if n in dic[place]: -        print("POSSIBLE") -        break -else: -    print("IMPOSSIBLE") +N, M = list(map(int, input().split())) +sa = set() +sb = set() +for i in range(M): +    a, b = list(map(int, input().split())) +    if a == 1: +        sb.add(b) +    if b == N: +        sa.add(a) +print(("IMPOSSIBLE" if len(sa & sb) == 0 else "POSSIBLE"))