CodeEff/ECCO huggingface dataset:
# Original solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
def main():
    N, M = tuple(map(int, input().split()))
    A = tuple(tuple(map(int, input().split())) for _ in range(M))
    S, D = set(), set()  # start, destination
    for a, b in A:
        if a == 1:
            S |= {b}
        if b == N:
            D |= {a}
    flg = S & D  # if the same X in both S & D -> possible
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

# Optimized solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
import sys
input = sys.stdin.readline

def main():
    N, M = input().split()
    A = tuple(input().split() for _ in range(int(M)))
    S, D = set(), set()  # start, destination
    for a, b in A:
        if a == "1":
            S |= {b}
        if b == N:
            D |= {a}
    flg = S & D  # if the same X in both S & D -> possible
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()
# Original solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
import sys
input = sys.stdin.readline

def main():
    N, M = tuple(map(int, input().split()))
    A = tuple(tuple(map(int, input().split())) for _ in range(M))
    S, D = set(), set()  # start, destination
    for a, b in A:
        if a == 1:
            S |= {b}
        if b == N:
            D |= {a}
    flg = S & D  # if the same X in both S & D -> possible
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()


# Optimized solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
import sys
input = sys.stdin.readline

def main():
    N, M = tuple(map(int, input().split()))
    A = tuple(tuple(map(int, input().split())) for _ in range(M))
    S, D = set(), set()  # start, destination
    for a, b in A:
        if a == 1:
            S.add(b)
        if b == N:
            D.add(a)
    flg = S & D  # if the same X in both S & D -> possible
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()
# Original solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
import sys
input = sys.stdin.readline

def dijkstra(s: int) -> int:
    D = [float("inf")] * (N + 1)  # distance
    D[s] = 0
    used = [0] * (N + 1)
    while True:
        v = -1
        for i in range(1, N + 1):
            if not used[i] and (v == -1 or D[i] < D[v]):
                v = i
        if v == -1:
            break
        used[v] = 1
        for j in range(1, N + 1):
            D[j] = min(D[j], D[v] + cost[v][j])
    return D[-1]


def main():
    global N, cost
    N, M = tuple(map(int, input().split()))
    E = tuple(tuple(map(int, input().split())) for _ in range(M))
    # cost[v][u] := cost from vertex v to u
    cost = [[float("inf")] * (N + 1) for _ in range(N + 1)]
    for v, u in E:
        cost[v][u] = 1
        cost[u][v] = 1
    flg = dijkstra(1) <= 2
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

# Optimized solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
# DFS O(N + M)
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)


def dfs(v: int) -> None:
    for u in G[v]:  # search vertices available from v recursively
        if dist[u] > dist[v] + 1:
            dist[u] = dist[v] + 1
            dfs(u)


def main():
    global G, dist
    N, M = tuple(map(int, input().split()))  # vertices and edges
    E = tuple(tuple(map(int, input().split())) for _ in range(M))
    G = [[] for _ in range(N + 1)]  # graph, N+1: 1-idx
    for v, u in E:  # construct a graph according to edges' info
        G[v] += [u]
        G[u] += [v]
    dist = [float("inf")] * (N + 1)  # distance from vertex 1
    dist[1] = 0
    dfs(1)  # search from vertex 1
    flg = dist[-1] <= 2
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()
# Original solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
# DFS O(N + M)
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)


def dfs(v: int) -> None:
    for u in G[v]:  # search vertices available from v recursively
        if dist[u] > dist[v] + 1:
            dist[u] = dist[v] + 1
            dfs(u)


def main():
    global G, dist
    N, M = tuple(map(int, input().split()))  # vertices and edges
    E = tuple(tuple(map(int, input().split())) for _ in range(M))
    G = [[] for _ in range(N + 1)]  # graph, N+1: 1-idx
    for v, u in E:  # construct a graph according to edges' info
        G[v] += [u]
        G[u] += [v]
    dist = [float("inf")] * (N + 1)  # distance from vertex 1
    dist[1] = 0
    dfs(1)  # search from vertex 1
    flg = dist[-1] <= 2
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

# Optimized solution
# ABC068C - Cat Snuke and a Voyage (ARC079C)
def main():
    N, M, *AB = list(map(int, open(0).read().split()))
    sources, targets = set(), set()
    for a, b in zip(*[iter(AB)] * 2):
        if a == 1:
            sources.add(b)
        if b == N:
            targets.add(a)
    flg = sources & targets  # intermediate point of both 1, N exists?
    print(("POSSIBLE" if flg else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()
# Original solution
N, M = list(map(int, input().split()))
edges = [[] for i in range(N)]

for i in range(M):
  a, b = list(map(int, input().split()))
  a -= 1
  b -= 1
  edges[a].append(b)

for i in edges[0]:
  if N-1 in edges[i]:
    print("POSSIBLE")
    exit()
print("IMPOSSIBLE")    

# Optimized solution
N, M = list(map(int, input().split()))
edges = [[] for i in range(N)]

for i in range(M):
  a, b = list(map(int, input().split()))
  edges[a].append(b)

for i in edges[1]:
  if N in edges[i]:
    print("POSSIBLE")
    exit()
print("IMPOSSIBLE")
# Original solution
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]:
  for nv in G[v]:
    if nv == N-1:
      print("POSSIBLE")
      exit()
print("IMPOSSIBLE")

# Optimized solution
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")
# Original solution
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")

# Optimized solution
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")
# Original solution
from sys import stdin
from collections import deque
def main():
    #入力
    readline=stdin.readline
    n,m=list(map(int,readline().split()))
    G=[[] for _ in range(n+1)]
    for _ in range(m):
        a,b=list(map(int,readline().split()))
        G[a].append(b)
        G[b].append(a)

    #bfs
    q=deque([tuple((1,0))])
    flags=[False]*(n+1)
    flags[1]=True
    ans=False
    while len(q)>0:
        now,d=q.popleft()
        if now==n:
            if d==2:
                ans=True
                break
        for nex in G[now]:
            if flags[nex]==False:
                flags[nex]=True
                q.append(tuple((nex,d+1)))

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

if __name__=="__main__":
    main()

# Optimized solution
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n,m=list(map(int,readline().split()))
    G=[[] for _ in range(n+1)]
    for _ in range(m):
        a,b=list(map(int,readline().split()))
        G[a].append(b)
        G[b].append(a)

    s=set(G[1])
    ans=False
    while len(s)>0:
        now=s.pop()
        for nex in G[now]:
            if nex==n:
                ans=True
                break

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

if __name__=="__main__":
    main()
# Original solution
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]

ship_list1 = []
ship_list2 = []
count = 0
loop = False

for i in range(m):
    if ab[i][0] == 1:
        ship_list1.append(ab[i])
    if ab[i][1] == n:
        ship_list2.append(ab[i])

for ship1 in ship_list1:
    for ship2 in ship_list2:
        if ship1[1] == ship2[0]:
            print('POSSIBLE')
            count += 1
            loop = True
            break
    if loop:
        break

if count == 0:
    print('IMPOSSIBLE')

# Optimized solution
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]

ship_list1 = []
ship_list2 = []
count = 0
loop = False

for i in range(m):
    if ab[i][0] == 1:
        ship_list1.append(ab[i][1])
    if ab[i][1] == n:
        ship_list2.append(ab[i][0])

if len(set(ship_list1) & set(ship_list2)) >= 1:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
# Original solution
#21:06
N,M=list(map(int,input().split()))
l=[]
for i in range(M):
    l.append(list(map(int,input().split())))
first=[]
last=[]

for t in l:
    if t[0]==1:
        first.append(t[1])
    elif t[1]==N:
        last.append(t[0])
flag=False
for s in first:
    if s in last:
        flag=True
        break
if flag:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

# Optimized solution
#21:06
N,M=list(map(int,input().split()))
l=[]
for i in range(M):
    l.append(list(map(int,input().split())))
first=[]
last=[]
H=[[] for i in range(N)]
for t in l:
    H[t[0]-1].append(t[1])
    H[t[1]-1].append(t[0])
#if H[0][0]==H[N-1][0]
#print(any(N in H[0]))
#for v in H[0]:
if any(N in H[v-1] for v in H[0]):
    #N is exist in first
    #1 to i to N
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Original solution
import math

def solve(n, m, a, b):
    islands = []

    for i in range(m):
        if(a[i] == 1):
            islands.append(b[i])
        if(b[i] == 1):
            islands.append(a[i])

    for i in range(m):
        if(a[i] == n and b[i] in islands):
            return "POSSIBLE"
        if(b[i] == n and a[i] in islands):
            return "POSSIBLE"
    return "IMPOSSIBLE"

(n, m) = list(map(int, input().split()))
a = []
b = []

for i in range(m):
    (ai, bi) = list(map(int, input().split()))
    a.append(ai)
    b.append(bi)

print((solve(n, m, a, b)))


# Optimized solution
def solve(n, m, a, b):
    islands = set()

    for i in range(m):
        if(a[i] == 1):
            islands.add(b[i])
        if(b[i] == 1):
            islands.add(a[i])

    for i in range(m):
        if(a[i] == n and b[i] in islands):
            return "POSSIBLE"
        if(b[i] == n and a[i] in islands):
            return "POSSIBLE"
    return "IMPOSSIBLE"

(n, m) = list(map(int, input().split()))
a = []
b = []

for i in range(m):
    (ai, bi) = list(map(int, input().split()))
    a.append(ai)
    b.append(bi)

print((solve(n, m, a, b)))
# Original solution
n, m = list(map(int, input().split()))

s = []
e = []
for _ in range(m):
  a, b = list(map(int, input().split()))
  if a == 1:
    s.append((a, b))
  if b == n:
    e.append((a, b))
    
for a, b in s:
  for a2, b2 in e:
    if b == a2:
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')

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

s = []
e = []
for _ in range(m):
  a, b = list(map(int, input().split()))
  if a == 1:
    s.append(b)
  if b == n:
    e.append(a)

if set(s) & set(e):
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
# Original solution
N,M = list(map(int,input().split()))
a=[0]*M
b=[0]*M
c=[] #最初の候補地

for i in range(M):
  a[i],b[i]=list(map(int,input().split()))
  if a[i]==1:
    if b[i] not in c:
      c.append(b[i])
    
for j in range(M):
  if a[j]!=1:
    if a[j] in c:
      if b[j]==N:
        print("POSSIBLE")
        break
else:
  print("IMPOSSIBLE")

# Optimized solution
N,M = list(map(int,input().split()))
a=[0]*M
b=[0]*M
c=set() #最初の候補地

for i in range(M):
  a[i],b[i]=list(map(int,input().split()))
  if a[i]==1:
    if b[i] not in c:
      c.add(b[i])
    
for j in range(M):
  if a[j]!=1:
    if a[j] in c:
      if b[j]==N:
        print("POSSIBLE")
        break
else:
  print("IMPOSSIBLE")
# Original solution
from collections import deque

n,m=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]

sx=0
gx=n-1

tree=[[] for i in range(n)]
for i in l:
    tree[i[0]-1].append(i[1]-1)
    tree[i[1]-1].append(i[0]-1)

dist=[-1 for i in range(n)]
dist[sx]=0

que=deque()
que.append(sx)

while que:
    x=que.popleft()

    if x==gx and dist[gx]==2:
        print('POSSIBLE')
        exit()
    elif x==gx and dist[gx]!=2:
        print('IMPOSSIBLE')
        exit()

    for j in tree[x]:
        if dist[j]==-1:
            que.append(j)
            dist[j]=dist[x]+1

print('IMPOSSIBLE')

# Optimized solution
n,m=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]

tree=[[] for i in range(n)]
for i in l:
    tree[i[0]-1].append(i[1]-1)
    tree[i[1]-1].append(i[0]-1)

for i in tree:
    if 0 in i and n-1 in i:
        print('POSSIBLE')
        exit()
print('IMPOSSIBLE')
# Original solution
n,m=list(map(int,input().split()))

tree=[[] for i in range(n)]
for i in range(m):
  a,b=list(map(int,input().split()))
  a-=1
  b-=1
  tree[a].append(b)
  tree[b].append(a)

for i in tree[0]:
  for j in tree[i]:
    if j==n-1:
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')

# Optimized solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))

n,m=nii()

tree=[[] for i in range(n)]
for i in range(m):
  a,b=nii()
  a-=1
  b-=1
  tree[a].append(b)
  tree[b].append(a)

for i in tree[0]:
  for j in tree[i]:
    if j==n-1:
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')
# Original solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))

n,m=nii()

tree=[[] for i in range(n)]
for i in range(m):
  a,b=nii()
  a-=1
  b-=1
  tree[a].append(b)
  tree[b].append(a)

for i in tree[0]:
  for j in tree[i]:
    if j==n-1:
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')

# Optimized solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))

def main():
  n,m=nii()

  tree=[[] for i in range(n)]
  for i in range(m):
    a,b=nii()
    a-=1
    b-=1
    tree[a].append(b)
    tree[b].append(a)

  for i in tree[0]:
    for j in tree[i]:
      if j==n-1:
        print('POSSIBLE')
        exit()
  print('IMPOSSIBLE')

if __name__=="__main__":
  main()
# Original solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))

def main():
  n,m=nii()

  tree=[[] for i in range(n)]
  for i in range(m):
    a,b=nii()
    a-=1
    b-=1
    tree[a]+=[b]
    tree[b]+=[a]

  for i in tree[0]:
    for j in tree[i]:
      if j==n-1:
        print('POSSIBLE')
        exit()
  print('IMPOSSIBLE')

if __name__=="__main__":
  main()

# Optimized solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))

def main():
  n,m=nii()

  tree=[[] for i in range(n)]
  for i in range(m):
    a,b=nii()
    a-=1
    b-=1
    tree[a].append(b)
    tree[b].append(a)

  for i in tree[0]:
    for j in tree[i]:
      if j==n-1:
        print('POSSIBLE')
        exit()
  print('IMPOSSIBLE')

if __name__=="__main__":
  main()
# Original solution
#!/usr/bin/env python3
from collections import deque

n, m = list(map(int, input().split()))
graph = [deque([]) for _ in range(n + 1)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    graph[a].append(b)
    graph[b].append(a)
for i in graph[1]:
    if n in graph[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


# Optimized solution
#!/usr/bin/env python3
n, m = input().split()
a = set()
b = set()
for _ in range(int(m)):
    r = set(input().split())
    if "1" in r:
        a |= r
    if n in r:
        b |= r
print(("POSSIBLE" if len(a & b) > 0 else "IMPOSSIBLE"))
# Original solution
# coding: utf-8
N,M=list(map(int,input().split()))
G=[[] for i in range(N+1)]

for i in range(M):
    a,b=list(map(int,input().split()))
    G[a].append(b)
    G[b].append(a)

flg=False

near=[]

for i in range(len(G[1])):
    near.append(G[1][i])

for i in range(len(G[N])):
    if G[N][i] in near:
        flg=True

if flg:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


# Optimized solution
# coding: utf-8
N,M=list(map(int,input().split()))
G=[[] for i in range(N+1)]

for i in range(M):
    a,b=list(map(int,input().split()))
    G[a].append(b)
    G[b].append(a)

flg=False

near=[False for i in range(N+1)]

for i in range(len(G[1])):
    near[G[1][i]]=True

for i in range(len(G[N])):
    if near[G[N][i]]:
        flg=True

if flg:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Original solution
#!/usr/bin/python

import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        N, M = [int(x) for x in line.split(" ", 2)]

        services_1 = []
        services_n = []
        for i in range(M):
            a, b = [int(x) for x in sys.stdin.readline().split(" ", 2)]
            if a == 1:
                services_1.append(b)
            if b == N:
                services_n.append(a)

        if 1 in services_n:
            print("POSSIBLE")

        result = "IMPOSSIBLE"
        for service in services_n:
            if service == 1 or service in services_1:
                result = "POSSIBLE"
                break
        print(result)                

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

# Optimized solution
#!/usr/bin/python

import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        N, M = [int(x) for x in line.split(" ", 2)]

        services_1 = {}
        services_n = []
        for i in range(M):
            a, b = [int(x) for x in sys.stdin.readline().split(" ", 2)]
            if a == 1:
                services_1[b] = True
            if b == N:
                services_n.append(a)

        if 1 in services_n:
            print("POSSIBLE")

        result = "IMPOSSIBLE"
        for service in services_n:
            if service == 1 or service in services_1:
                result = "POSSIBLE"
                break
        print(result)                

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)
# Original solution
import sys
import collections


input = sys.stdin.readline


def main():
    N, M = [int(x) for x in input().split()]
    ab = [[] for j in range(N + 1)]
    distance = [0] * (N + 1)
    for _ in range(M):
        a, b = [int(x) for x in input().split()]
        ab[a].append(b)
        ab[b].append(a)

    q = collections.deque()
    q.append([1, 0])

    visited = set()
    visited.add(1)

    while q:
        c, d = q.popleft()

        for n in ab[c]:
            if n not in visited:
                visited.add(n)
                q.append([n, d + 1])
                distance[n] = d + 1

    if distance[N] != 0 and distance[N] <=2:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")




    
    
    

if __name__ == '__main__':
    main()



# Optimized solution
N, M = [int(x) for x in input().split()]
AB = [[int(x) for x in input().split()] for _ in range(M)]


x = set()
for a, b in AB:
    if a == 1:
        x.add(b)
    if b == 1:
        x.add(a)

f = False

for a, b in AB:
    if (a in x and b == N) or (b in x and a == N):
        f = True

if f:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Original solution
n,m = list(map(int,input().split()))
one_li = []
to_n_li = []
for _ in range(m):
    a,b = list(map(int,input().split()))
    if a == 1:
        one_li.append(b)
    if b == n:
        to_n_li.append(a)
#print(one_li,to_n_li)
for o in list(set(one_li)):
    if o in list(set(to_n_li)):
        print('POSSIBLE')
        exit()
else:
    print('IMPOSSIBLE')

# Optimized solution
n,m = list(map(int,input().split()))
one_li = []
to_n_li = []
for _ in range(m):
    a,b = list(map(int,input().split()))
    if a == 1:
        one_li.append(b)
    if b == n:
        to_n_li.append(a)
ll = len(set(one_li) & set(to_n_li))
if ll == 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')
# Original solution
N, M = list(map(int,input().split( )))
l = []
for i in range(M):
	a,b = list(map(int,input().split( )))
	l.append([a, b])

ans = 'IMPOSSIBLE'
for i in range(M):
	if l[i][0] == 1:
		t = l[i][1]
		for j in range(M):
			if l[j][0] == t and l[j][1] == N:
				ans = 'POSSIBLE'
print(ans)

# Optimized solution
N, M = list(map(int,input().split( )))
l = []
for i in range(M):
	a,b = list(map(int,input().split( )))
	l.append([a, b])

t_a = []
t_b = []

ans = 'IMPOSSIBLE'
for i in range(M):
	if l[i][0] == 1:
		t_a.append(l[i][1])
	elif l[i][1] == N:
		t_b.append(l[i][0])
t_and = set(t_a) & set(t_b)
t_and_l = list(t_and)
if len(t_and_l) > 0:
	ans = 'POSSIBLE'
print(ans)
# Original solution
arr = input().split()
n = int(arr[0])
m = int(arr[1])

a = [0] * m
b = [0] * m

mat = [[0] * n for i in range(n)]
path = []
for i in range(m):
    tmp = input().split()
    a[i] = int(tmp[0])
    b[i] = int(tmp[1])
    mat[a[i]-1][b[i]-1] = 1
    if a[i] == 1:
        path.append(b[i]-1)

flag = False
for i in range(len(path)):
        if mat[path[i]][n-1] == 1: 
            flag = True
            break

if flag == True:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
    

# Optimized solution
arr = input().split()
n = int(arr[0])
m = int(arr[1])

x = []
y = []

for i in range(m):
    a,b = list(map(int, input().split()))
    if a == 1:
        x.append(b)
    if b == n:
        y.append(a)

if len(set(x+y)) < len(x) + len(y):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
# Original solution
island, fune = map(int, input().split(" "))
route = []
for i in range(fune):
    route.append(list(map(int, input().split(" "))))
pos = False
temp = []
for i in range(fune):
    if route[i][0] == 1:
        temp.append(route[i][1])
for j in range(fune):
    if route[j][1] == island:
        if route[j][0] in temp:
            pos = True
            break
print("POSSIBLE") if pos else print("IMPOSSIBLE")


# Optimized solution
island, fune = map(int, input().split(" "))
route = []
for i in range(fune):
    route.append(list(map(int, input().split(" "))))
temp = []
for i in range(fune):
    if route[i][0] == 1:
        temp.append(route[i][1])
for j in range(fune):
    if route[j][1] == island:
        temp.append(route[j][0])


print("POSSIBLE") if len(temp) != len(list(set(temp))) else print("IMPOSSIBLE")
# Original solution
n,m = list(map(int,input().split()))
a = [set(map(int,input().split())) for i in range(m)]

for i in range(m-1):
    for j in range(i+1,m):
        if ((a[i]|a[j])-(a[i]&a[j])) == {1,n}:
            print("POSSIBLE")
            exit()
else:
    print("IMPOSSIBLE")

# Optimized solution
n,m = list(map(int,input().split()))
X = set()
Y = set()
for i in range(m):
    a,b = list(map(int,input().split()))
    if a == 1:
        X.add(b)
    if b == n:
        Y.add(a) 
print(("IMPOSSIBLE" if not X&Y else "POSSIBLE"))
# Original solution
n, m = list(map(int, input().split()))
arr = []
for i in range(m):
    a, b = list(map(int, input().split()))
    arr.append((a,b))

one = set([b for a, b in arr if a == 1])
last = set([a for a, b in arr if b == n])
connect = one & last
if len(connect) >= 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

# Optimized solution
n, m = list(map(int, input().split()))
arr_ = [tuple(map(int, input().split())) for _ in range(m)]

one = set([b for a, b in arr_ if a == 1])
last = set([a for a, b in arr_ if b == n])
connect = one & last
if len(connect) >= 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")