import Foundation

func readInts() -> [Int]{
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main(){
    let xn = readInts()
    let exclusionInts = readInts()
    if exclusionInts.isEmpty{
        print(xn[0])
        return
    }
    for i in 1...100{
        if xn[0] - i == 0 || xn[0] + i == 100{
            print(i)
            return
        }
        if !exclusionInts.contains(xn[0]-i){
            print(xn[0]-i)
            return
        }
    }
}

main()


