let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (N, M) = (input[0], input[1])
var arr = (0..<N).map{_ in 0}
 
for _ in 0..<M {
  let input = readLine()!.characters.split(" ").map{Int(String($0))!}
  let (a, b) = (input[0], input[1])
  if a == 1 {
    arr[b] += 1
  }
  if b == N {
    arr[a] += 1
  }
}
print((arr.contains(2) ? "" : "IM") + "POSSIBLE")