function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    var X = input[0].map(e => parseInt(e, 10))[0];
	var N = input[0].map(e => parseInt(e, 10))[1];
	var ans = 0;
  	if (N == 0){
      	ans = X;
    } else {
    	var vec_p = input[1].map(e => parseInt(e, 10));
	    var tmpDiff = X;
    	for (var i = 1; i <= 101; i++){
    		if (vec_p.indexOf(i) == -1){
    			if (Math.abs(i - X) < tmpDiff){
	              tmpDiff = Math.abs(i - X);
    				ans = i;
    			}
    		}
    	}
    }
    console.log(ans);
}   

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