extension String: CollectionType {}
import Foundation
#if os(OSX) || os(iOS)
    import Darwin
#elseif os(Linux)
    import Glibc
#endif
let nm = readLine()!.split(" ").flatMap({ Int($0) })
let (n, m) = (nm[0], nm[1])
var sx = Set<Int>(), xe = Set<Int>()
for i in 0..<m {
    let ab = readLine()!.split(" ").flatMap({ Int($0) })
    let (a, b) = (ab[0], ab[1])
    if a == 1 {
        sx.insert(b)
    } else if b == n {
        xe.insert(a)
    }
}
print(sx.intersect(xe).count > 0 ? "POSSIBLE" : "IMPOSSIBLE")