ma = lambda :map(int,input().split())

n,m = ma()

tr = [[] for i in range(n)]

for i in range(m):

    a,b = ma()

    tr[a-1].append(b-1)

    tr[b-1].append(a-1)

f = False

for i in tr[0]:

    for s in tr[i]:

        if s==n-1:

            f =True

print("POSSIBLE") if f else print("IMPOSSIBLE")

ma = lambda :map(int,input().split())

n,m = ma()

st = [False]*(n+1)

goal = [False]*(n+1)

for i in range(m):

    a,b = ma()

    if a==n:

        goal[b] =True

    if b==n:

        goal[a] =True

    if a==1:

        st[b] = True

    if b==1:

        st[a] = True

f = False

for i in range(1,n+1):

    if st[i] and  goal[i]:

         f=True

print("POSSIBLE") if f else print("IMPOSSIBLE")

  

ma = lambda: map(int, input().split())
n, m = ma()
tr = [[] for i in range(n)]
for i in range(m):
    a, b = ma()
    tr[a - 1].append(b - 1)
    tr[b - 1].append(a - 1)
f = False
for i in tr[0]:
    for s in tr[i]:
        if s == n - 1:
            f = True
print("POSSIBLE") if f else print("IMPOSSIBLE")

ma = lambda: map(int, input().split())
n, m = ma()
st = [False] * (n + 1)
goal = [False] * (n + 1)
for i in range(m):
    a, b = ma()
    if a == n:
        goal[b] = True
    if b == n:
        goal[a] = True
    if a == 1:
        st[b] = True
    if b == 1:
        st[a] = True
f = False
for i in range(1, n + 1):
    if st[i] and goal[i]:
        f = True
print("POSSIBLE") if f else print("IMPOSSIBLE")

-tr = [[] for i in range(n)] +st = [False] * (n + 1) +goal = [False] * (n + 1) -    tr[a - 1].append(b - 1) -    tr[b - 1].append(a - 1) +    if a == n: +        goal[b] = True +    if b == n: +        goal[a] = True +    if a == 1: +        st[b] = True +    if b == 1: +        st[a] = True -for i in tr[0]: -    for s in tr[i]: -        if s == n - 1: -            f = True +for i in range(1, n + 1): +    if st[i] and goal[i]: +        f = True