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

s = {tuple(map(int, input().split())) for _ in range(m)}



for i in range(2, n):

    route = [1, i, n]

    if all(edge in s for edge in zip(route, route[1:])):

        print('POSSIBLE')

        break

else:

    print('IMPOSSIBLE')



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

transit_a = set()

transit_b = set()

for _ in range(m):

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

    if a == 1:

        transit_b |= {b}

    elif b == n:

        transit_a |= {a}



print(('POSSIBLE' if len(transit_a & transit_b) else 'IMPOSSIBLE'))
n, m = list(map(int, input().split()))
s = {tuple(map(int, input().split())) for _ in range(m)}
for i in range(2, n):
    route = [1, i, n]
    if all(edge in s for edge in zip(route, route[1:])):
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
transit_a = set()
transit_b = set()
for _ in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        transit_b |= {b}
    elif b == n:
        transit_a |= {a}
print(("POSSIBLE" if len(transit_a & transit_b) else "IMPOSSIBLE"))

-s = {tuple(map(int, input().split())) for _ in range(m)} -for i in range(2, n): -    route = [1, i, n] -    if all(edge in s for edge in zip(route, route[1:])): -        print("POSSIBLE") -        break -else: -    print("IMPOSSIBLE") +transit_a = set() +transit_b = set() +for _ in range(m): +    a, b = list(map(int, input().split())) +    if a == 1: +        transit_b |= {b} +    elif b == n: +        transit_a |= {a} +print(("POSSIBLE" if len(transit_a & transit_b) else "IMPOSSIBLE"))