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

ab = [sorted(list(map(int, input().split()))) for _ in range(M)]



fst = []

scnd = {}



for i in ab:

  if i[0]==1:

    fst.append(i[1])

  if N in i:

    idx = i.index(N)

    scnd[i[1-idx]] = 0



#print(scnd,fst)

    

for j in fst:

  if j in scnd:

    print("POSSIBLE")

    exit()

print("IMPOSSIBLE")

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

AB = [list(map(int, input().split())) for _ in range(m)]



cont_1 = set()

cont_n = set()



for ab in AB:

  a, b = ab

  if 1 in ab:

    cont_1.add(a)

    cont_1.add(b)

  if n in ab:

    cont_n.add(a)

    cont_n.add(b)



if cont_1 & cont_n:

  print("POSSIBLE")

else:

  print("IMPOSSIBLE")
N, M = list(map(int, input().split()))
ab = [sorted(list(map(int, input().split()))) for _ in range(M)]
fst = []
scnd = {}
for i in ab:
    if i[0] == 1:
        fst.append(i[1])
    if N in i:
        idx = i.index(N)
        scnd[i[1 - idx]] = 0
# print(scnd,fst)
for j in fst:
    if j in scnd:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(m)]
cont_1 = set()
cont_n = set()
for ab in AB:
    a, b = ab
    if 1 in ab:
        cont_1.add(a)
        cont_1.add(b)
    if n in ab:
        cont_n.add(a)
        cont_n.add(b)
if cont_1 & cont_n:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-N, M = list(map(int, input().split())) -ab = [sorted(list(map(int, input().split()))) for _ in range(M)] -fst = [] -scnd = {} -for i in ab: -    if i[0] == 1: -        fst.append(i[1]) -    if N in i: -        idx = i.index(N) -        scnd[i[1 - idx]] = 0 -# print(scnd,fst) -for j in fst: -    if j in scnd: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +n, m = list(map(int, input().split())) +AB = [list(map(int, input().split())) for _ in range(m)] +cont_1 = set() +cont_n = set() +for ab in AB: +    a, b = ab +    if 1 in ab: +        cont_1.add(a) +        cont_1.add(b) +    if n in ab: +        cont_n.add(a) +        cont_n.add(b) +if cont_1 & cont_n: +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")