'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 setA = new Set()
  let setB = new Set()
  for (let i = 0; i < ships.length; i++) {
    if (ships[i][0] == 1) {
      setA.add(ships[i][1])
    }
    if (ships[i][1] == n) {
      setB.add(ships[i][0])
    }
  }
  // console.log(shipsA, shipsB)

  for (let i = 1; i < n; i++) {
    if (setA.has(i) && setB.has(i)) {

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