CodeEff/ECCO huggingface dataset:
# Original solution
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N,M =LI()
X,Y=[],[]
for i in range(M):
	a = LI()
	if a[0] == 1:
		X.append(a[1])
	if a[1] == N:
		Y.append(a[0])
	
for x in X:
	if x in Y:
		print("POSSIBLE")
		exit()
	

	
print("IMPOSSIBLE")


# Optimized solution
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N,M =LI()
X,Y=[],[]
for i in range(M):
	a = LI()
	if a[0] == 1:
		X.append(a[1])
	if a[1] == N:
		Y.append(a[0])
X=set(X)
Y=set(Y)
for x in X:
	if x in Y:
		print("POSSIBLE")
		exit()
	

	
print("IMPOSSIBLE")
# Original solution
n,m=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]
c=0
for j in range(n):
  if [j,1] in l or [1,j] in l:
    if [j,n] in l or [n,j] in l:
      c+=1
      break
if c==1:print('POSSIBLE')
else:print('IMPOSSIBLE')

# Optimized solution
n,m=list(map(int,input().split()))
L=[];l=[]
for k in range(n):
  L.append(0)
for i in range(m):
  x=list(map(int,input().split()))
  l.append(x)
  if x[0]==1:
    L[x[1]]+=1
  if x[1]==1:
    L[x[0]]+=1
  if x[0]==n:
    L[x[1]]+=1
  if x[1]==n:
    L[x[0]]+=1
if max(L)==2:print('POSSIBLE')
else:print('IMPOSSIBLE')
# Original solution
N , M = list(map(int,input().split()))
L = []
transit1 = set()
transit2 = set()
for _ in range(M):
    t = tuple(map(int,input().split()))
    L.append(t)
for x in L :
    if x[1] == N:
        transit1.add(x[0])
    if x[0] == 1:
        transit2.add(x[1])
if transit1 & transit2 == set():
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")


# Optimized solution
import sys
input = sys.stdin.readline
N , M = list(map(int,input().split()))
L = []
transit1 = set()
transit2 = set()
for _ in range(M):
    t = tuple(map(int,input().split()))
    L.append(t)
for x in L :
    if x[1] == N:
        transit1.add(x[0])
    if x[0] == 1:
        transit2.add(x[1])
if transit1 & transit2 == set():
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
# Original solution
N, M = list(map(int, input().rstrip().split()))

st = []
tt = []

for i in range(M):
    s, t = list(map(int, input().rstrip().split()))
    if s == 1:
        st.append(t)
    
    if t == N:
        tt.append(s)

st.sort()
tt.sort()
result = 'IMPOSSIBLE'
for s in st:
    if s in tt:
        result = 'POSSIBLE'
        break


print(result)
        


# Optimized solution
N, M = list(map(int, input().rstrip().split()))

st = []
dic = {}

for i in range(M):
    s, t = list(map(int, input().rstrip().split()))
    if s == 1:
        st.append(t)
    
    if t == N:
        dic[s] = 0

result = 'IMPOSSIBLE'
for s in st:
    if s in dic:
        result = 'POSSIBLE'
        break


print(result)
# Original solution
import sys
from collections import deque

N, M = list(map(int, sys.stdin.readline().strip().split()))

paths = [[] for _ in range(N+1)]
for _ in range(M):
    a, b = list(map(int, sys.stdin.readline().strip().split()))
    paths[a].append(b)
    paths[b].append(a)

q = deque([(1, 0)])
while q:
    p, c = q.popleft()
    if c > 2:
        continue
    if p == N:
        print("POSSIBLE")
        sys.exit()
    for next_p in paths[p]:
        q.append((next_p, c+1))

print("IMPOSSIBLE")

# Optimized solution
import sys
from collections import deque

N, M = list(map(int, sys.stdin.readline().strip().split()))

paths = [[] for _ in range(N+1)]
for _ in range(M):
    a, b = list(map(int, sys.stdin.readline().strip().split()))
    paths[a].append(b)
    paths[b].append(a)

q = deque([(1, 0)])
visited = set()
while q:
    p, c = q.popleft()
    if p in visited:
        continue
    visited.add(p)
    if c > 2:
        continue
    if p == N:
        print("POSSIBLE")
        sys.exit()
    for next_p in paths[p]:
        q.append((next_p, c+1))

print("IMPOSSIBLE")
# Original solution
import sys
from collections import deque

N, M = list(map(int, sys.stdin.readline().strip().split()))

paths = [[] for _ in range(N+1)]
for _ in range(M):
    a, b = list(map(int, sys.stdin.readline().strip().split()))
    paths[a].append(b)
    paths[b].append(a)

q = deque([(1, 0)])
visited = set()
while q:
    p, c = q.popleft()
    if p in visited:
        continue
    visited.add(p)
    if c > 2:
        continue
    if p == N:
        print("POSSIBLE")
        sys.exit()
    for next_p in paths[p]:
        q.append((next_p, c+1))

print("IMPOSSIBLE")

# Optimized solution
import sys

N, M = list(map(int, sys.stdin.readline().strip().split()))

paths = [[] for _ in range(N+1)]
for _ in range(M):
    a, b = list(map(int, sys.stdin.readline().strip().split()))
    paths[a].append(b)
    paths[b].append(a)

for i in paths[1]:
    for j in paths[i]:
        if j == N:
            print("POSSIBLE")
            sys.exit()
print("IMPOSSIBLE")
# Original solution
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))
def LI2(): return [int(eval(input())) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print(('\n'.join(x)))
def printni(x): print(('\n'.join(list(map(str,x)))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n,m=MI()
lis=[LI() for i in range(m)]
pas=[]
for i in range(m):
    if lis[i][0]==1:
        pas.append(lis[i][1])
for i in range(m):
    if lis[i][1]==n:
        if lis[i][0] in pas:
            print("POSSIBLE")
            sys.exit()
print("IMPOSSIBLE")

# Optimized solution
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))
def LI2(): return [int(eval(input())) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print(('\n'.join(x)))
def printni(x): print(('\n'.join(list(map(str,x)))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n,m=MI()
lis=[LI() for i in range(m)]
nums=[]
for i in range(m):
    if lis[i][0]==1:
        nums.append(lis[i][1])
    if lis[i][1]==n:
        nums.append(lis[i][0])
#print(nums)
if len(nums)>len(list(set(nums))):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Original solution
import collections

n,m=list(map(int,input().split()))
a,b,c=[],[],[]
for i in range(m):
    A=list(map(int,input().split()))
    a.append(A)
for i in range(m):
    if a[i][1]==n:
        b.append(a[i][0])
    elif a[i][0]==1:
        c.append(a[i][1])
if len(b)>0:
    b=list(set(b))
    c=list(set(c))
    for i in b:
        for j in c:
            if i==j:
                print("POSSIBLE")
                exit()
print("IMPOSSIBLE")


# Optimized solution
import collections

n,m=list(map(int,input().split()))
a,b,c=[],[],[]
for i in range(m):
    A=list(map(int,input().split()))
    a.append(A)
for i in range(m):
    if a[i][1]==n:
        b.append(a[i][0])
    elif a[i][0]==1:
        c.append(a[i][1])
if len(set(b)&set(c))>0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Original solution


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

es = [[] for _ in range(N+1)]

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


for i in range(2,N):
    if i in es[1] and N in es[i]:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")

# Optimized solution


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

s = set()
g = set()

for i in range(M):
    a,b = list(map(int, input().split()))
    if a == 1:
        s.add(b)
    elif b == N:
        g.add(a)


ans = len(s & g) > 0
print(("POSSIBLE" if ans else "IMPOSSIBLE"))
# Original solution
import sys

def possible():
    print("POSSIBLE")
    sys.exit()

def main():
    N, M = list(map(int, input().split()))
    hashdict = dict()
    for i in range(157):
        hashdict[i] = list()
    alist = list()
    for i in range(M):
        a, b = list(map(int, input().split()))
        if a == 1:
            temp = b % 157
            hashdict[temp].append(b)
        if b == N:
            alist.append(a)

    for start in alist:
        temp = start % 157
        if start in hashdict[temp]:
            possible()
    print("IMPOSSIBLE")

if __name__ == "__main__":
    main()

# Optimized solution
import sys

def possible():
    print("POSSIBLE")
    sys.exit()

def main():
    N, M = list(map(int, input().split()))
    hashdict = dict()
    for i in range(1009):
        hashdict[i] = list()
    alist = list()
    for i in range(M):
        a, b = list(map(int, input().split()))
        if a == 1:
            temp = b % 1009
            hashdict[temp].append(b)
        if b == N:
            alist.append(a)

    for start in alist:
        temp = start % 1009
        if start in hashdict[temp]:
            possible()
    print("IMPOSSIBLE")

if __name__ == "__main__":
    main()
# Original solution
n,m=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(m):
  c,d=list(map(int,input().split()))
  if c==1:
    a[d-1]=1
  if d==n:
    b[c-1]=1
success=0
for i in range(1,n):
  if a[i]*b[i]==1:
    success=1
if success==1:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

# Optimized solution
n,m=list(map(int,input().split()))
a=[0]*(n+1)
b=[0]*(n+1)
for i in range(m):
  x,y=list(map(int,input().split()))
  if x==1:
    a[y]=1
  if y==n:
    b[x]=1
ans=0
for i in range(n+1):
  ans+=a[i]*b[i]
if ans==0:
  print('IMPOSSIBLE')
else:
  print('POSSIBLE')
# Original solution
N, M = [int(x) for x in input().split()]
S = []
from1 = []
fromN = []
ans = "IMPOSSIBLE"
for i in range(M):
	S.append([int(x) for x in input().split()])
	if S[i][0] == 1:
		from1.append(S[i][1])
	if S[i][1] == N:
		fromN.append(S[i][0])

for x in from1:
	if x in fromN:
		ans = "POSSIBLE"

print(ans)

# Optimized solution
N, M = [int(x) for x in input().split()]
S1 = []
S2 = []
for i in range(M):
	S1 = [int(x) for x in input().split()]
	if S1[0] == 1:
		S2.append(S1[1])
	if S1[1] == N:
		S2.append(S1[0])
		
if len(S2) == len(set(S2)):
	print("IMPOSSIBLE")
else:
	print("POSSIBLE")
# Original solution
n, m = list(map(int, input().split()))
s = []
e = []
for i in range(m):
    x, y = list(map(int, input().split()))
    if x == 1:
        s.append(y)
    elif y == n:
        e.append(x)
s.sort()
e.sort()
flag = False
for i in s:
    for j in e:
        if i < j:
            break
        if i == j:
            flag = True
            break
if flag:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

# Optimized solution
n, m = list(map(int, input().split()))
s = [0 for i in range(n)]
e = [0 for i in range(n)]
for i in range(m):
    x, y = list(map(int, input().split()))
    if x == 1:
        s[y] = 1
    elif y == n:
        e[x] = 1
flag = False
for i in range(n):
    if s[i] == 1 and e[i] == 1:
        flag = True
        break
if flag:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Original solution
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math


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

ans = False
routes = {}
for i in range(N):
    routes[i+1] = []
for ai in range(len(a)):
    x,y = a[ai]
    if 1 in a[ai]:
        routes[1] = routes[1]+a[ai]
    if N in a[ai]:
        routes[N] = routes[N]+a[ai]

# print(routes)
if 1 in routes[N] or N in routes[1]:
    print("POSSIBLE")
    exit()

s_reach = list(set(routes[1]))
N_reach = list(set(routes[N]))
Ms_reach = list(set(N_reach+s_reach))

if len(s_reach)+len(N_reach) != len(Ms_reach):
    print("POSSIBLE")
    exit()

print("IMPOSSIBLE")


# Optimized solution
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math


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

ans = False
routes_s = []
routes_g = []

for ai in range(len(a)):
    if 1 in a[ai]:
        inx = a[ai].index(1)
        routes_s.append(a[ai][inx-1])
    if N in a[ai]:
        inx = a[ai].index(N)
        routes_g.append(a[ai][inx-1])

# print(routes)
if 1 in routes_g or N in routes_s:
    print("POSSIBLE")
    exit()

s_reach = list(set(routes_s))
g_reach = list(set(routes_g))
sg_reach = list(set(g_reach+s_reach))

if len(s_reach)+len(g_reach) != len(sg_reach):
    print("POSSIBLE")
    exit()

print("IMPOSSIBLE")
# Original solution
n,m = list(map(int,input().split()))
ahoge = []
hanege = []
for i in range(m):
    ai,bi = list(map(int,input().split()))
    if ai == 1:
        ahoge.append(bi)
    if bi == n:
        hanege.append(ai)
flag = 0
for i in ahoge:
    if i in hanege:
        print("POSSIBLE")
        flag = 1
        break
if flag == 0:
    print("IMPOSSIBLE")

# Optimized solution
n,m = list(map(int,input().split()))
ahoge = []
hanege = []
for i in range(m):
    ai,bi = list(map(int,input().split()))
    if ai == 1:
        ahoge.append(bi)
    if bi == n:
        hanege.append(ai)
ahoge.sort()
hanege.sort()
def bis(i):
    under = 0
    upper = len(hanege)-1
    while under <= upper:
        l = (under+upper)//2
        if i == hanege[l]:
            return 1
        elif i < hanege[l]:
            upper = l-1
        elif i > hanege[l]:
            under = l+1
    return 0
flag = 0
for i in ahoge:
    if bis(i) == 1:
        print("POSSIBLE")
        flag = 1
        break
if flag == 0:
    print("IMPOSSIBLE")
# Original solution
n,m = list(map(int,input().split()))
ahoge = []
hanege = []
for i in range(m):
    ai,bi = list(map(int,input().split()))
    if ai == 1:
        ahoge.append(bi)
    if bi == n:
        hanege.append(ai)
ahoge.sort()
hanege.sort()
def bis(i):
    under = 0
    upper = len(hanege)-1
    while under <= upper:
        l = (under+upper)//2
        if i == hanege[l]:
            return 1
        elif i < hanege[l]:
            upper = l-1
        elif i > hanege[l]:
            under = l+1
    return 0
flag = 0
for i in ahoge:
    if bis(i) == 1:
        print("POSSIBLE")
        flag = 1
        break
if flag == 0:
    print("IMPOSSIBLE")

# Optimized solution
N,M = list(map(int,input().split()))
l = []
r = []
for i in range(M):
    a,b = list(map(int,input().split()))
    if a == 1:
        l.append(b)
    elif b == N:
        r.append(a)
s = set(l).intersection(set(r))
print(("POSSIBLE" if len(s) else "IMPOSSIBLE"))
# Original solution
N, M = list(map(int, input().split()))

a = [0] * M
b = [0] * M

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

# N in b    
indices = [i for i, x in enumerate(b) if x == N]
# matched b of a in b
for i in range(len(indices)):
#    print(a[indices[i]])
#    print(b[indices[i]])
    
    indices_2 = [ii for ii, x in enumerate(b) if x == a[indices[i]]]
    
#    print(indices_2)
    
    if len(indices_2) == 0:
        continue
    
    for j in range(len(indices_2)):
#        print(indices_2)
#        print(a[indices_2[j]])
        
        if a[indices_2[j]] == 1:
            print('POSSIBLE')
            quit()
            
print('IMPOSSIBLE')


# Optimized solution
a=[]
b={}
n,m=list(map(int,input().split()))
for _ in range(m):
	i,j=list(map(int,input().split()))
	if i==1:
		a.append(j)
	elif j==n:
		b[i]=1
for i in a:
	if i in b:
		print('POSSIBLE')
		break
else:
	print('IMPOSSIBLE')
# Original solution
n, m = list(map(int, input().split()))
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)


for i in range(m):
    a,b = list(map(int, input().split()))
    dat_m[a] = dat_m[a] + [b]
    if b == n:
        dat_finish[a] = True
#print(dat_m)
#print(dat_finish)

c = False
for i in dat_m[1]:
    if dat_finish[i]:
        c = True
print(("POSSIBLE" if c else "IMPOSSIBLE"))

# Optimized solution
n, m = list(map(int, input().split()))
dat = []
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)

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

#print(dat)
for i in range(m):
    a,b = dat[i]
    if b == n:
        dat_finish[a] = True
#print(dat_finish)

c = False
for i in range(m):
    a,b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True

print(("POSSIBLE" if c else "IMPOSSIBLE"))
# Original solution
from collections import deque
n, m = list(map(int, input().split()))
dat = deque([])
dat_finish = [False] * (n + 1)

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

for i in range(m):
    a, b = dat[i]
    if b == n:
        dat_finish[a] = True

c = False
for i in range(m):
    a, b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True

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

# Optimized solution
from collections import deque
n, m = list(map(int, input().split()))
dat = deque([])
dat2 = deque([])
dat_finish = [False] * (n + 1)

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

for i in range(m):
    a, b = dat.pop()
    if b == n:
        dat_finish[a] = True

c = False
for i in range(m):
    a, b = dat2.pop()
    if a == 1:
        if dat_finish[b]:
            c = True

print(("POSSIBLE" if c else "IMPOSSIBLE"))
# Original solution
from collections import deque
n, m = list(map(int, input().split()))
dat = deque([])
dat2 = deque([])
dat_finish = [False] * (n + 1)

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

for i in range(m):
    a, b = dat.pop()
    if b == n:
        dat_finish[a] = True

c = False
for i in range(m):
    a, b = dat2.pop()
    if a == 1:
        if dat_finish[b]:
            c = True

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


# Optimized solution
n, m = list(map(int, input().split()))
dat_m = [[] for x in range(n+1)]
for i in range(m):
    a, b = list(map(int, input().split()))
    dat_m[a].append(b)
c = False
for i in dat_m[1]:
    if n in dat_m[i]:
        c = True
print(("POSSIBLE" if c else "IMPOSSIBLE"))
# Original solution
import collections
N, M = list(map(int, input().split()))
graph = collections.defaultdict(lambda:set())
for _ in range(M):
    a, b = list(map(int, input().split()))
    graph[a-1].add(b-1)
    graph[b-1].add(a-1)

def bfs(v, goal, graph, seen, next_v, rank):
    for x in graph[v]:
        if x == goal:
            return True
        if x in seen:
            continue
        next_v.append(x)
        rank.append(rank[0]+1)
        seen.add(x)
    return False


next_v = [0]
rank = [0]
seen = {0}
#bfs
while True:
    if len(next_v) == 0 or rank[0] == 2:
        ans = "IMPOSSIBLE"
        break
    if bfs(next_v[0], N-1, graph, seen, next_v, rank):
        ans = "POSSIBLE"
        break
    next_v.pop(0)
    rank.pop(0)
print(ans)

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

def bfs(goal, graph, seen, next_v):
    for x in graph[next_v[0][0]]:
        if x == goal:
            return True
        if x in seen:
            continue
        next_v.append((x,next_v[0][1]+1))
        seen.add(x)
    return False


next_v = [(0,0)]
seen = {0}
#bfs
while True:
    if len(next_v) == 0 or next_v[0][1] == 2:
        ans = "IMPOSSIBLE"
        break
    if bfs(N-1, graph, seen, next_v):
        ans = "POSSIBLE"
        break
    next_v.pop(0)
print(ans)
# Original solution
N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]

toN = list([x for x in AB if N in x])
toN = [flatten for inner in toN for flatten in inner]
frm_first = list([x for x in AB if 1 in x])
frm_first = [flatten for inner in frm_first for flatten in inner]

for v in frm_first:
    if v in toN:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

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

toN = list([x for x in AB if N in x])
toN = set([flatten for inner in toN for flatten in inner])
frm_first = list([x for x in AB if 1 in x])
frm_first = set([flatten for inner in frm_first for flatten in inner])

if toN & frm_first:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Original solution
import sys
input=sys.stdin.readline
import collections

def main():
    N,M = list(map(int, input().split()))
    A = []
    for _ in range(M):
        A.append(list(map(int, input().split())))
    X1 = []
    for a in A:
        if a[0] == 1:
            X1.append(a)
    X2 = []
    for a in A:
        if a[1] == N:
            X2.append(a)
    for x1 in X1:
        for x2 in X2:
            if x1[1] == x2[0]:
                print("POSSIBLE")
                return
    print("IMPOSSIBLE")

if __name__ == '__main__':
    main()


# Optimized solution
import sys
input=sys.stdin.readline

def main():
    N,M = list(map(int, input().split()))
    A = []
    for _ in range(M):
        A.append(list(map(int, input().split())))
    p1 = set()
    for a in A:
        if a[0] == 1:
            p1.add(a[1])
    for a in A:
        if a[1] == N and a[0] in p1:
            print("POSSIBLE")
            return
    print("IMPOSSIBLE")

if __name__ == '__main__':
    main()
# Original solution
import sys
input=sys.stdin.readline

def main():
    N,M = list(map(int, input().split()))
    A = []
    for _ in range(M):
        A.append(list(map(int, input().split())))
    p1 = set()
    for a in A:
        if a[0] == 1:
            p1.add(a[1])
    for a in A:
        if a[1] == N and a[0] in p1:
            print("POSSIBLE")
            return
    print("IMPOSSIBLE")

if __name__ == '__main__':
    main()


# Optimized solution
import sys
input=sys.stdin.readline

def main():
    N,M = list(map(int, input().split()))
    A = []
    for _ in range(M):
        A.append(list(map(int, input().split())))
    p1 = [0]*N
    for a in A:
        if a[0] == 1:
            p1[a[1]] = 1
    for a in A:
        if a[1] == N and p1[a[0]]:
            print("POSSIBLE")
            return
    print("IMPOSSIBLE")

if __name__ == '__main__':
    main()