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

ahoge = []

hanege = []

for i in range(m):

    ai,bi = list(map(int,input().split()))

    if ai == 1:

        ahoge.append(bi)

    if bi == n:

        hanege.append(ai)

ahoge.sort()

hanege.sort()

def bis(i):

    under = 0

    upper = len(hanege)-1

    while under <= upper:

        l = (under+upper)//2

        if i == hanege[l]:

            return 1

        elif i < hanege[l]:

            upper = l-1

        elif i > hanege[l]:

            under = l+1

    return 0

flag = 0

for i in ahoge:

    if bis(i) == 1:

        print("POSSIBLE")

        flag = 1

        break

if flag == 0:

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

l = []

r = []

for i in range(M):

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

    if a == 1:

        l.append(b)

    elif b == N:

        r.append(a)

s = set(l).intersection(set(r))

print(("POSSIBLE" if len(s) else "IMPOSSIBLE"))
n, m = list(map(int, input().split()))
ahoge = []
hanege = []
for i in range(m):
    ai, bi = list(map(int, input().split()))
    if ai == 1:
        ahoge.append(bi)
    if bi == n:
        hanege.append(ai)
ahoge.sort()
hanege.sort()


def bis(i):
    under = 0
    upper = len(hanege) - 1
    while under <= upper:
        l = (under + upper) // 2
        if i == hanege[l]:
            return 1
        elif i < hanege[l]:
            upper = l - 1
        elif i > hanege[l]:
            under = l + 1
    return 0


flag = 0
for i in ahoge:
    if bis(i) == 1:
        print("POSSIBLE")
        flag = 1
        break
if flag == 0:
    print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
l = []
r = []
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        l.append(b)
    elif b == N:
        r.append(a)
s = set(l).intersection(set(r))
print(("POSSIBLE" if len(s) else "IMPOSSIBLE"))

-n, m = list(map(int, input().split())) -ahoge = [] -hanege = [] -for i in range(m): -    ai, bi = list(map(int, input().split())) -    if ai == 1: -        ahoge.append(bi) -    if bi == n: -        hanege.append(ai) -ahoge.sort() -hanege.sort() - - -def bis(i): -    under = 0 -    upper = len(hanege) - 1 -    while under <= upper: -        l = (under + upper) // 2 -        if i == hanege[l]: -            return 1 -        elif i < hanege[l]: -            upper = l - 1 -        elif i > hanege[l]: -            under = l + 1 -    return 0 - - -flag = 0 -for i in ahoge: -    if bis(i) == 1: -        print("POSSIBLE") -        flag = 1 -        break -if flag == 0: -    print("IMPOSSIBLE") +N, M = list(map(int, input().split())) +l = [] +r = [] +for i in range(M): +    a, b = list(map(int, input().split())) +    if a == 1: +        l.append(b) +    elif b == N: +        r.append(a) +s = set(l).intersection(set(r)) +print(("POSSIBLE" if len(s) else "IMPOSSIBLE"))