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 = UnsafeMutablePointer<Bool>.alloc(n+1)
var xe = UnsafeMutablePointer<Bool>.alloc(n+1)
for i in 0..<m {
    let ab = readLine()!.split(" ")
    let (a, b) = (Int(ab[0])!, Int(ab[1])!)
    if a == 1 {
        sx.advancedBy(b).memory = true
    } else if b == n {
        xe.advancedBy(a).memory = true
    }
}
var ans = "IMPOSSIBLE"
for i in 0..<n {
    if sx.advancedBy(i).memory && xe.advancedBy(i).memory {
        ans = "POSSIBLE"
        break
    }
}
print(ans)
sx.dealloc(n+1); xe.dealloc(n+1)