'use strict'

function main(input) {
  input = input.split('\n').map(v => v.split(' ').map(v => ~~v))
  const n = input[0][0]
  const M = input[0][1]
  const ships = input.slice(1, input.length)

  let shipsA = Array.apply(null, {
    length: n
  }).map(v => false) //1から出る船
  let shipsB = Array.apply(null, {
    length: n
  }).map(v => false) //5へ行く船
  for (let i = 0; i < M; i++) {
    if (ships[i][0] == 1) {
      shipsA[ships[i][1]] = true
    }
    if (ships[i][1] == n) {
      shipsB[ships[i][0]] = true
    }
  }
  // console.log(shipsA, shipsB)
  for (let i = 1; i < n; i++) {
    if (shipsA[i] == true && shipsB[i] == true) {

      console.log('POSSIBLE')
      return
    }
  }
  let ans = 'IMPOSSIBLE'
  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
