output_description: If it is possible to go to Island N by using two boat services, print
  `POSSIBLE`; otherwise, print `IMPOSSIBLE`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      a_1 b_1
      a_2 b_2
      :
      a_M b_M
attempt: def getinputdata():
  
      # 配列初期化
      array_result = []
  
      data = input()
  
      array_result.append(data.split(" "))
  
      flg = True
  
      try:
  
          while flg:
  
              data = input()
  
              array_temp = []
  
              if data != "":
  
                  array_result.append(data.split(" "))
  
                  flg = True
  
              else:
  
                  flg = False
      finally:
  
          return array_result
  
  
  arr_data = getinputdata()
  
  # 島数
  n = arr_data[0][0]
  m = int(arr_data[0][1])
  
  arr01 = []
  arr02 = []
  for i in range(1, 1 + m):
  
      if arr_data[i][0] == "1":
  
          arr01.append(arr_data[i][1])
  
      if arr_data[i][1] == n:
  
          arr02.append(arr_data[i][0])
  
  
  print("POSSIBLE" if len(list(set(arr01) & set(arr02))) == 1 else "IMPOSSIBLE")
  
problem_description: Statement
  
  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.
samples: [{"input": "3 2\n    1 2\n    2 3", "output": "POSSIBLE\n    \n\n* * *"}, {"input": "4 3\n    1 2\n    2 3\n    3 4", "output": "IMPOSSIBLE\n    \n\nYou have to use three boat services to get to Island 4.\n\n* * *"}, {"input": "100000 1\n    1 99999", "output": "IMPOSSIBLE\n    \n\n* * *"}, {"input": "5 5\n    1 3\n    4 5\n    2 3\n    2 4\n    1 4", "output": "POSSIBLE\n    \n\nYou can get to Island 5 by using two boat services: Island 1 -> Island 4 ->\nIsland 5."}]