// inputに入力データ全体が入る
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
   	input = input.split("\n");
  	var tmp = input[0].split(" ");
    //文字列から10進数に変換するときはparseIntを使います
    var goalIsland = parseInt(tmp[0], 10);
    var shipVariation = parseInt(tmp[1], 10);
    var shipVariationArray = new Array(shipVariation);
  	var successCheck =0;
  	for(var i=0; i<shipVariation; i++){
    	shipVariationArray[i] = input[i+1].split(" ");
    }
  	for(var fromI=0; fromI<shipVariation; fromI++){
      if(parseInt(shipVariationArray[fromI][0])==1){
     	for(var fromJ=0; fromJ<shipVariation; fromJ++){
       		if(parseInt(shipVariationArray[fromJ][0])==parseInt(shipVariationArray[fromI][1])){
              if(parseInt(shipVariationArray[fromJ][1])==goalIsland){
                successCheck=1;
                break;
              }
            }
        }
        
      }
    }
    //出力
  	if(successCheck==1){
		console.log('POSSIBLE');
    }
  	else{
   		console.log('IMPOSSIBLE'); 
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));