function main(input){
  var input = input.trim();
  var input = input.split("\n");
  var kazu = parseInt(input[0].split(" ")[0]);
  var answer;
  if(input[1]){var fList = input[1].split(" ");}
  else{fList=[];}
  for(var i=0; i<fList.length; i++){fList[i]=parseInt(fList[i]);}
  var nList = [];
  for(var i=0; i<101; i++){
    if(fList.includes(i)==false){
      nList[nList.length]=[i,Math.abs(kazu-i)];
    }
  }
  // console.log(nList);
  nList.sort(function (a, b) {
    return (a[1] - b[1]);
  });
  console.log(nList[0][0]);
  // console.log(nList);
}//main(input);
main(require("fs").readFileSync("/dev/stdin", "utf8"));