"use strict"
function main(arg) {
    let [X,N] = arg.trim().split("\n")[0].split(" ").map(Number)
    let P = []
    // console.log(arg.trim().split("\n").length)
    if (arg.trim().split("\n").length > 1) {
        P = arg.trim().split("\n")[1].split(" ").map(Number)
    } 
    let minValue = 101
    let minKey = 1
    for (let i = 1; i <= 100; i++) {
        if (P.includes(i)) {
            continue
        }
        let a = Math.abs(i-X)
        // console.log([i,a])
        if (a < minValue) {
            minKey = i
            minValue = a
        }
    }
    console.log(minKey)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));