x, n = list(map(int, input().split(' ')))

min_num = 100



ls = [0] * 201

for i in range(0, 201):

    ls[i] = i



ls_in = [0] * n

if n > 0:

    ls_in = list(map(int, input().split(' ')))

    for i in ls_in:

        ls.remove(i)

    ls.reverse()

    for i in ls:

        min_num = min(abs(x-i), min_num)

        if abs(x-i) == min_num:

            ans = i 

    print(ans)

else:

    print(x)
x, n = list(map(int, input().split(' ')))

diff = x

result = 0



if n != 0:

    ls = list(map(int, input().split(' ')))

    ls_remaind = []

    for i in range(1, 102):

        if i not in ls:

            ls_remaind.append(i)

    for j in ls_remaind:

        if abs(x-j) == diff:

            result = min(result, j)

        elif abs(x-j) < diff:

            diff = abs(x-j)

            result = j

else:

    result = x



print(result)
x, n = list(map(int, input().split(" ")))
min_num = 100
ls = [0] * 201
for i in range(0, 201):
    ls[i] = i
ls_in = [0] * n
if n > 0:
    ls_in = list(map(int, input().split(" ")))
    for i in ls_in:
        ls.remove(i)
    ls.reverse()
    for i in ls:
        min_num = min(abs(x - i), min_num)
        if abs(x - i) == min_num:
            ans = i
    print(ans)
else:
    print(x)

x, n = list(map(int, input().split(" ")))
diff = x
result = 0
if n != 0:
    ls = list(map(int, input().split(" ")))
    ls_remaind = []
    for i in range(1, 102):
        if i not in ls:
            ls_remaind.append(i)
    for j in ls_remaind:
        if abs(x - j) == diff:
            result = min(result, j)
        elif abs(x - j) < diff:
            diff = abs(x - j)
            result = j
else:
    result = x
print(result)

-min_num = 100 -ls = [0] * 201 -for i in range(0, 201): -    ls[i] = i -ls_in = [0] * n -if n > 0: -    ls_in = list(map(int, input().split(" "))) -    for i in ls_in: -        ls.remove(i) -    ls.reverse() -    for i in ls: -        min_num = min(abs(x - i), min_num) -        if abs(x - i) == min_num: -            ans = i -    print(ans) +diff = x +result = 0 +if n != 0: +    ls = list(map(int, input().split(" "))) +    ls_remaind = [] +    for i in range(1, 102): +        if i not in ls: +            ls_remaind.append(i) +    for j in ls_remaind: +        if abs(x - j) == diff: +            result = min(result, j) +        elif abs(x - j) < diff: +            diff = abs(x - j) +            result = j -    print(x) +    result = x +print(result)