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

s = [[int(i) for i in input().split()] for i in range(m)]

d = {}



for i in range(m):

    if s[i][0] == 1:

        d[s[i][1]] = 1

    

for i in range(m):

    if s[i][1] == n and s[i][0] in d:

        print("POSSIBLE")

        exit()



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

d1 = {}

d2 = {}

for i in range(m):

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

    if a == 1: d1[b] = 1

    if b == n: d2[a] = 1



for k in d1:

    if k in d2: 

        ans = "POSSIBLE"

        break

else:

    ans = "IMPOSSIBLE"



print(ans)
n, m = list(map(int, input().split()))
s = [[int(i) for i in input().split()] for i in range(m)]
d = {}
for i in range(m):
    if s[i][0] == 1:
        d[s[i][1]] = 1
for i in range(m):
    if s[i][1] == n and s[i][0] in d:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
d1 = {}
d2 = {}
for i in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        d1[b] = 1
    if b == n:
        d2[a] = 1
for k in d1:
    if k in d2:
        ans = "POSSIBLE"
        break
else:
    ans = "IMPOSSIBLE"
print(ans)

-s = [[int(i) for i in input().split()] for i in range(m)] -d = {} +d1 = {} +d2 = {} -    if s[i][0] == 1: -        d[s[i][1]] = 1 -for i in range(m): -    if s[i][1] == n and s[i][0] in d: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +    a, b = list(map(int, input().split())) +    if a == 1: +        d1[b] = 1 +    if b == n: +        d2[a] = 1 +for k in d1: +    if k in d2: +        ans = "POSSIBLE" +        break +else: +    ans = "IMPOSSIBLE" +print(ans)