function Main(input) {
  input = input.split("\n");
  var tmp = input[0].split(" ");
  //島のゴールを格納
  var goalIsland = parseInt(tmp[0], 10);
  //船の種類を格納
  var shipVariation = parseInt(tmp[1], 10);
  isReachCheck(setShipVariations(shipVariation,input),goalIsland);
}

//島に到着するかを確認する関数
var isReachCheck = (shipVariations,goalIsland) => {
  var isPossible = false;
  for(var shipVariationIndexOne=0; shipVariationIndexOne<shipVariations.length; shipVariationIndexOne++){
    if(parseInt(shipVariations[shipVariationIndexOne][0])==1){
      for(var shipVariationIndexTwo=0; shipVariationIndexTwo<shipVariations.length; shipVariationIndexTwo++){
        if(parseInt(shipVariations[shipVariationIndexTwo][0])==parseInt(shipVariations[shipVariationIndexOne][1])){
          if(parseInt(shipVariations[shipVariationIndexTwo][1])==goalIsland){
            isPossible = true;
            break;
          }
        }
      }
    }
  }
  isPossibleCheck(isPossible);
}

//booleanを判別する関数
var isPossibleCheck = (isPossible) => {
  if(isPossible){
    console.log('POSSIBLE');
  }
  else{
    console.log('IMPOSSIBLE'); 
  }    
}

//船の特徴を配列に格納する関数
var setShipVariations = (shipVariation,input) => {
  var shipVariations = new Array(shipVariation);
  for(var i=0; i<shipVariation; i++){
    shipVariations[i] = input[i+1].split(" ");
  }
  return shipVariations;
}


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