from collections import defaultdict

d = defaultdict(list)

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

for _ in range(m):

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

    d[a].append(b)



# アクセスを高速にするためにsetに変換

for a in list(d.keys()):

    d[a] = set(d[a])





def solve(n, d):

    for a in d[1]:

        if n in d[a]:

            return 'POSSIBLE'

    return 'IMPOSSIBLE'





print((solve(n, d)))

from collections import defaultdict

d = defaultdict(set)

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

for _ in range(m):

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

    d[a].add(b)





def solve(n, d):

    for a in d[1]:

        if n in d[a]:

            return 'POSSIBLE'

    return 'IMPOSSIBLE'





print((solve(n, d)))

from collections import defaultdict

d = defaultdict(list)
n, m = list(map(int, input().split()))
for _ in range(m):
    a, b = list(map(int, input().split()))
    d[a].append(b)
# アクセスを高速にするためにsetに変換
for a in list(d.keys()):
    d[a] = set(d[a])


def solve(n, d):
    for a in d[1]:
        if n in d[a]:
            return "POSSIBLE"
    return "IMPOSSIBLE"


print((solve(n, d)))

from collections import defaultdict

d = defaultdict(set)
n, m = list(map(int, input().split()))
for _ in range(m):
    a, b = list(map(int, input().split()))
    d[a].add(b)


def solve(n, d):
    for a in d[1]:
        if n in d[a]:
            return "POSSIBLE"
    return "IMPOSSIBLE"


print((solve(n, d)))

-d = defaultdict(list) +d = defaultdict(set) -    d[a].append(b) -# アクセスを高速にするためにsetに変換 -for a in list(d.keys()): -    d[a] = set(d[a]) +    d[a].add(b)