function main(input){
    var tmp;
    input = input.split("\n");
    tmp = input[0].split(" ");
    var N = Number(tmp[0]);
    var M = Number(tmp[1]);
    var p1 = new Array(input.length);
    var p2 = new Array(input.length);
    p1.fill(false);
    p2.fill(false);

    for(var i=0; i<input.length; i++){
        tmp = input[i].split(" ");
        if(Number(tmp[0])==1){
            p1[Number(tmp[1])] = true;
        }
        if(Number(tmp[1])==N){
            p2[Number(tmp[0])] = true;
        }
    }

    var index = -1;
    while(true){
        var index = p1.indexOf(true, index+1);
        if(index<0){
            console.log("IMPOSSIBLE");
            return;
        }else{
            if(p2[index]){
                console.log("POSSIBLE");
                return;
            }
        }
    }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));