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

L = [list(map(int, input().split())) for _ in range(M)]



G = [[] for _ in range(N)]

for x, y in L:

  x, y = x-1, y-1

  G[x].append(y)

  G[y].append(x)



for v in G[0]:

  if N-1 in G[v]:

    print("POSSIBLE")

    exit()

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

G = [[] for _ in range(N)]

for i in range(M):

  a, b = [int(x)-1 for x in input().split()]

  G[a].append(b)



for v in G[0]:

  for nv in G[v]:

    if nv == N-1:

      print("POSSIBLE")

      exit()

print("IMPOSSIBLE")
N, M = list(map(int, input().split()))
L = [list(map(int, input().split())) for _ in range(M)]
G = [[] for _ in range(N)]
for x, y in L:
    x, y = x - 1, y - 1
    G[x].append(y)
    G[y].append(x)
for v in G[0]:
    if N - 1 in G[v]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
G = [[] for _ in range(N)]
for i in range(M):
    a, b = [int(x) - 1 for x in input().split()]
    G[a].append(b)
for v in G[0]:
    for nv in G[v]:
        if nv == N - 1:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")

-L = [list(map(int, input().split())) for _ in range(M)] -for x, y in L: -    x, y = x - 1, y - 1 -    G[x].append(y) -    G[y].append(x) +for i in range(M): +    a, b = [int(x) - 1 for x in input().split()] +    G[a].append(b) -    if N - 1 in G[v]: -        print("POSSIBLE") -        exit() +    for nv in G[v]: +        if nv == N - 1: +            print("POSSIBLE") +            exit()