const Main = input => {
    input = input.split("\n");
    const xn = input[0].split(" ").map(value => parseInt(value, 10));

    const x = xn[0];
    const n = xn[1];

    let near;
    if(n === 0) {
        //nが0のときはx自身を答えにする
        near = x;
    } else {
        const p = input[1].split(" ").map(value => parseInt(value, 10));

        //pに存在する整数を除いた1~100までのリスト
        const list = [];
        for(let i = 0; i <= 101; i++) {
            if(p.includes(i)) continue;
            list.push(i);
        }

        near = 0;
        list.forEach(value => {
            if(Math.abs(value - x) < Math.abs(near - x)) {
                near = value;
            }
        })
    }

    console.log(near);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));