In Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands. For convenience, we will call them Island 1, Island 2, ..., Island N.  There are M kinds of regular boat services between these islands. Each service connects two islands. The i-th service connects Island a_i and Island b_i.  Cat Snuke is on Island 1 now, and wants to go to Island N. However, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.  Help him.
goal,n=map(int,input().split())
A=[]
for i in range(n):
  A.append(list(map(int,input().split())))
dp=[0 for i in range(200010)]
for i in range(n):
  if 1 in A[i]:
    dp[A[i][1]+1]+=1
if dp[goal+1]==1:
  print("POSSIBLE")
  exit()

tp=[0 for i in range(200010)]
for i in range(n):
  if goal in A[i]:
    dp[A[i][1-A[i].index(goal)]+1]+=1
for i in range(200010):
  if dp[i]==tp[i]==1:
    print("POSSIBLE")
    exit()
print("IMPOSSIBLE")
n,m=map(int,input().split())
M=[[] for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    a-=1;b-=1
    M[a].append(b)
    M[b].append(a)
yes="POSSIBLE";no="IMPOSSIBLE"

for i in M[0]:
    if n-1 in M[i]:
        print(yes);exit()
print(no)

