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



li1 = []

lin = []



for _ in range(m):

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

    if a == 1:

        li1.append(b)

    elif b == n:

        lin.append(a)



li1.sort()

lin.sort()



tmp = 0



if not len(lin):

    print('IMPOSSIBLE')

    exit()



for i in li1:

    while i > lin[tmp]:

        tmp += 1

        if tmp == len(lin):

            print('IMPOSSIBLE')

            exit()

    if i == lin[tmp]:

        print('POSSIBLE')

        exit()





print('IMPOSSIBLE')

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



li1 = [False] * n

lin = [False] * n



for _ in range(m):

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

    if a == 1:

        li1[b-1] = True

    elif b == n:

        lin[a-1] = True



for i in range(n):

    if li1[i] and lin[i]:

        print('POSSIBLE')

        exit()



print('IMPOSSIBLE')

n, m = list(map(int, input().split()))
li1 = []
lin = []
for _ in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        li1.append(b)
    elif b == n:
        lin.append(a)
li1.sort()
lin.sort()
tmp = 0
if not len(lin):
    print("IMPOSSIBLE")
    exit()
for i in li1:
    while i > lin[tmp]:
        tmp += 1
        if tmp == len(lin):
            print("IMPOSSIBLE")
            exit()
    if i == lin[tmp]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
li1 = [False] * n
lin = [False] * n
for _ in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        li1[b - 1] = True
    elif b == n:
        lin[a - 1] = True
for i in range(n):
    if li1[i] and lin[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

-li1 = [] -lin = [] +li1 = [False] * n +lin = [False] * n -        li1.append(b) +        li1[b - 1] = True -        lin.append(a) -li1.sort() -lin.sort() -tmp = 0 -if not len(lin): -    print("IMPOSSIBLE") -    exit() -for i in li1: -    while i > lin[tmp]: -        tmp += 1 -        if tmp == len(lin): -            print("IMPOSSIBLE") -            exit() -    if i == lin[tmp]: +        lin[a - 1] = True +for i in range(n): +    if li1[i] and lin[i]: