"use strict";
function Main(input) {
  var parseInputData = parseInput(input);
  const result = isReachCheck(parseInputData.shipVariations, parseInputData.goalIsland);
  isPossibleCheck(result);

}
var parseInput = (input) => {
  input = input.split("\n");
  const lines = input[0].split(" ");
  //島のゴールを格納
  const goalIsland = parseInt(lines[0], 10);
  //船の数を格納
  const shipCount = parseInt(lines[1], 10);
  var shipVariations = parseShipVariations(shipCount, input);
  return { shipVariations: shipVariations, goalIsland: goalIsland };
}

//島に到着するかを確認する関数
var isReachCheck = (shipVariations, goalIsland) => {
  const ship1Variations = shipVariations.filter(function (shipVariation) {
    return shipVariation[0] === 1;
  });
  return (shipVariations.some((ship2Variation) => {
    return (ship1Variations.some((ship1Variation) => {
      if (ship1Variation[1] === ship2Variation[0] && ship2Variation[1] === goalIsland) {
        return true;
      };
    })
    )
  }));
}

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

//船の特徴を配列に格納する関数
var parseShipVariations = (shipCount, lines) => {
  return lines.slice(1, shipCount + 1).map(line => line.split(" ").map(x => parseInt(x)));
}


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