// tested by Hightail - https://github.com/dj3500/hightail
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;
import std.datetime, std.bigint;

immutable inf = 101101101;
int n, m;
int[][] adj;

void main() {
    scan(n, m);
    adj = new int[][](n, 0);

    int ai, bi;

    foreach (i ; 0 .. m) {
        scan(ai, bi);
        ai--;
        bi--;
        adj[ai] ~= bi;
        adj[bi] ~= ai;
    }

    auto d = new int[](n);
    d[] = inf;
    d[0] = 0;

    auto q = DList!int();
    q.insertBack(0);

    while (!q.empty) {
        auto u = q.front;
        q.removeFront();

        if (u == n - 1) break;

        foreach (v ; adj[u]) {
            if (d[v] == inf) {
                d[v] = d[u] + 1;
                q.insertBack(v);
            }
        }
    }

    writeln(d[n - 1] == 2 ? "POSSIBLE" : "IMPOSSIBLE");
    
}




void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}