import Foundation
#if os(OSX) || os(iOS)
    import Darwin
#elseif os(Linux)
    import Glibc
#endif
protocol Scannable {
    static var format: String { get }
    static func scan() -> Self
}
extension Scannable {
    static func scan() -> Self {
        var arg: Self? = nil
        withUnsafeMutablePointer(&arg){withVaList([COpaquePointer($0)]){vscanf(self.format,$0)}}
        return arg!
    }
}
extension Int: Scannable { static var format: String { return "%d" } }
let n = Int.scan(), m = Int.scan()
var sx = UnsafeMutablePointer<Bool>.alloc(n+1)
var xe = UnsafeMutablePointer<Bool>.alloc(n+1)
memset(sx, 0, n+1); memset(xe, 0, n+1)
for i in 0..<m {
    let a = Int.scan(), b = Int.scan()
    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)