function Main(input){
    const arr = input.trim().split('\n');
    const XN = arr[0].split(' ').map(Number);
    if(XN[1] == 0){
        console.log(XN[0]);
        return;
    }
    const pn = arr[1].split(' ').map(Number);
    let diff = 999;
    let answer = 0;
    for(i=-0; i<=100; i++){
        if(pn.indexOf(i)>=0) continue;
        if(Math.abs(XN[0]-i) < diff){
            diff = Math.abs(XN[0]-i);
            answer = i;
        }
    }
    console.log(answer);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));