import Foundation
#if os(OSX) || os(iOS)
    import Darwin
#elseif os(Linux)
    import Glibc
#endif
var n = 0, m = 0, a = 0, b = 0
withUnsafeMutablePointer(&n){withVaList([COpaquePointer($0)]){vscanf("%d",$0)}}
withUnsafeMutablePointer(&m){withVaList([COpaquePointer($0)]){vscanf("%d",$0)}}
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 {
    withUnsafeMutablePointer(&a){withVaList([COpaquePointer($0)]){vscanf("%d",$0)}}
    withUnsafeMutablePointer(&b){withVaList([COpaquePointer($0)]){vscanf("%d",$0)}}
    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)