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

d = {str(x):[] for x in range(1,n+1)}

n = str(n)

ans = "IMPOSSIBLE"

for i in range(m):

    t = input().split()

    d[t[0]].append(t)



for l1 in d["1"]:

    if l1[1]==n:

        ans="POSSIBLE"

    else:

        for l2 in d[l1[1]]:

            if l2[1]==n:

                ans="POSSIBLE"

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

d = {str(x):[] for x in range(1,n+1)}

n = str(n)

ans = "IMPOSSIBLE"

for i in range(m):

    t = input().split()

    d[t[0]].append(t[1])



for l1 in d["1"]:

    if l1==n:

        ans="POSSIBLE"

        break

    else:

        for l2 in d[l1]:

            if l2==n:

                ans="POSSIBLE"

                break

print(ans)

n, m = list(map(int, input().split()))
d = {str(x): [] for x in range(1, n + 1)}
n = str(n)
ans = "IMPOSSIBLE"
for i in range(m):
    t = input().split()
    d[t[0]].append(t)
for l1 in d["1"]:
    if l1[1] == n:
        ans = "POSSIBLE"
    else:
        for l2 in d[l1[1]]:
            if l2[1] == n:
                ans = "POSSIBLE"
print(ans)

n, m = list(map(int, input().split()))
d = {str(x): [] for x in range(1, n + 1)}
n = str(n)
ans = "IMPOSSIBLE"
for i in range(m):
    t = input().split()
    d[t[0]].append(t[1])
for l1 in d["1"]:
    if l1 == n:
        ans = "POSSIBLE"
        break
    else:
        for l2 in d[l1]:
            if l2 == n:
                ans = "POSSIBLE"
                break
print(ans)

-    d[t[0]].append(t) +    d[t[0]].append(t[1]) -    if l1[1] == n: +    if l1 == n: +        break -        for l2 in d[l1[1]]: -            if l2[1] == n: +        for l2 in d[l1]: +            if l2 == n: +                break