import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    int N, M;
    readf("%d %d\n", &N, &M);
    int[] first;
    int[] last;
    foreach (i; 0..M) {
        int a, b;
        readf("%d %d\n", &a, &b);
        if (a == 1) first ~= b-1;
        if (b == N) last ~= a-1;
    }
    writeln(first.any!(a => last.canFind(a)) ? "POSSIBLE" : "IMPOSSIBLE");
}

