X, N = list(map(int, input().split()))

if N:

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

    for i in range(N // 2 + 3):

        if X - i not in p:

            print((X - i))

            break

        if X + i not in p:

            print((X + i))

            break

else:

    print(X)

X, N = list(map(int, input().split()))

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

for i in range(N // 2 + 3):

    if X - i not in p:

        print((X - i))

        break

    if X + i not in p:

        print((X + i))

        break

X, N = list(map(int, input().split()))
if N:
    p = list(map(int, input().split()))
    for i in range(N // 2 + 3):
        if X - i not in p:
            print((X - i))
            break
        if X + i not in p:
            print((X + i))
            break
else:
    print(X)

X, N = list(map(int, input().split()))
p = list(map(int, input().split()))
for i in range(N // 2 + 3):
    if X - i not in p:
        print((X - i))
        break
    if X + i not in p:
        print((X + i))
        break

-if N: -    p = list(map(int, input().split())) -    for i in range(N // 2 + 3): -        if X - i not in p: -            print((X - i)) -            break -        if X + i not in p: -            print((X + i)) -            break -else: -    print(X) +p = list(map(int, input().split())) +for i in range(N // 2 + 3): +    if X - i not in p: +        print((X - i)) +        break +    if X + i not in p: +        print((X + i)) +        break