extension String: CollectionType {}
import Foundation
#if os(OSX) || os(iOS)
    import Darwin
#elseif os(Linux)
    import Glibc
#endif
let nm = readLine()!.split(" ")
let (n, m) = (Int(nm[0])!, Int(nm[1])!)
var sx = [Bool](count: n, repeatedValue: false)
var xe = [Bool](count: n, repeatedValue: false)
var sxs = [Int](), xes = [Int]()
for i in 0..<m {
    let ab = readLine()!.split(" ")
    let (a, b) = (Int(ab[0])!, Int(ab[1])!)
    if a == 1 {
        sx[b] = true
        sxs.append(b)
    } else if b == n {
        xe[a] = true
        xes.append(a)
    }
}
if sxs.count > xes.count {
    swap(&sxs, &xes)
    swap(&sx, &xe)
}
var success = false
for x in sxs {
    if xe[x] {
        success = true
        break
    }
}
print(success ? "POSSIBLE" : "IMPOSSIBLE")