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

p = [int(_) for _ in input().split()]



not_in_p = [i for i in range(0, 102) if i not in p]

nip_temp = list([abs(x - s) for s in not_in_p])



address = nip_temp.index(min(nip_temp))

print((not_in_p[address]))

import sys

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

p = list(map(int, input().split()))

if n == 0:

    print(x)

    sys.exit()



not_in_p = []

for i in range(0, 102):

    if i not in p:

        not_in_p.append(abs(x-i))

    else:

        not_in_p.append(102)



address = not_in_p.index(min(not_in_p))

print(address)
x, n = list(map(int, input().split()))
p = [int(_) for _ in input().split()]
not_in_p = [i for i in range(0, 102) if i not in p]
nip_temp = list([abs(x - s) for s in not_in_p])
address = nip_temp.index(min(nip_temp))
print((not_in_p[address]))

import sys

x, n = list(map(int, input().split()))
p = list(map(int, input().split()))
if n == 0:
    print(x)
    sys.exit()
not_in_p = []
for i in range(0, 102):
    if i not in p:
        not_in_p.append(abs(x - i))
    else:
        not_in_p.append(102)
address = not_in_p.index(min(not_in_p))
print(address)

+import sys + -p = [int(_) for _ in input().split()] -not_in_p = [i for i in range(0, 102) if i not in p] -nip_temp = list([abs(x - s) for s in not_in_p]) -address = nip_temp.index(min(nip_temp)) -print((not_in_p[address])) +p = list(map(int, input().split())) +if n == 0: +    print(x) +    sys.exit() +not_in_p = [] +for i in range(0, 102): +    if i not in p: +        not_in_p.append(abs(x - i)) +    else: +        not_in_p.append(102) +address = not_in_p.index(min(not_in_p)) +print(address)