from collections import defaultdict

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

d = defaultdict(list)

for i in range(M):

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

    d[a].append(b)



for i,j in list(d.items()):

    if i!=1:

        continue

    for k in j:

        if N in d[k]:

            print('POSSIBLE')

            exit()

print('IMPOSSIBLE')
from collections import defaultdict

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

d = defaultdict(list)

for i in range(M):

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

    d[a].append(b)



for j in d[1]:

    if N in d[j]:

        print('POSSIBLE')

        exit()

print('IMPOSSIBLE')
from collections import defaultdict

N, M = list(map(int, input().split()))
d = defaultdict(list)
for i in range(M):
    a, b = list(map(int, input().split()))
    d[a].append(b)
for i, j in list(d.items()):
    if i != 1:
        continue
    for k in j:
        if N in d[k]:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")

from collections import defaultdict

N, M = list(map(int, input().split()))
d = defaultdict(list)
for i in range(M):
    a, b = list(map(int, input().split()))
    d[a].append(b)
for j in d[1]:
    if N in d[j]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

-for i, j in list(d.items()): -    if i != 1: -        continue -    for k in j: -        if N in d[k]: -            print("POSSIBLE") -            exit() +for j in d[1]: +    if N in d[j]: +        print("POSSIBLE") +        exit()