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

route = [0]*(n+10)

for i in range(m):

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

    if a == 1:

        route[b] += 1

    if b == n:

        route[a] += 1

if 2 in route:

    print("POSSIBLE")

else:

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



s = [0]*n

g = [0]*n



for i in range(m):

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

    if a == 1:

        s[b] = 1

    if b == n:

        g[a] = 1

for i in range(n):

    if s[i] and g[i]:

        print("POSSIBLE")

        exit()



print("IMPOSSIBLE")
n, m = list(map(int, input().split()))
route = [0] * (n + 10)
for i in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        route[b] += 1
    if b == n:
        route[a] += 1
if 2 in route:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
s = [0] * n
g = [0] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        s[b] = 1
    if b == n:
        g[a] = 1
for i in range(n):
    if s[i] and g[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

-route = [0] * (n + 10) +s = [0] * n +g = [0] * n -        route[b] += 1 +        s[b] = 1 -        route[a] += 1 -if 2 in route: -    print("POSSIBLE") -else: -    print("IMPOSSIBLE") +        g[a] = 1 +for i in range(n): +    if s[i] and g[i]: +        print("POSSIBLE") +        exit() +print("IMPOSSIBLE")