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

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



p = set(p)



diff = 101

indx = 0

if n != 0:

    for now in range(0, 102):

        if now not in p:

            now_diff = abs(now - x)

            if diff > now_diff:

                diff = now_diff

                indx = now

            else:

                break

    print(indx)

else:

    print(x)

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

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



p = set(p)



diff = 101

indx = 0

ans = (101, 0)

if n != 0:

    for now in range(0, 102):

        if now not in p:

            now_diff = abs(now - x)

            ans = min(ans, (now_diff, now))

    print((ans[1]))

else:

    print(x)

x, n = list(map(int, input().split()))
p = list(map(int, input().split()))
p = set(p)
diff = 101
indx = 0
if n != 0:
    for now in range(0, 102):
        if now not in p:
            now_diff = abs(now - x)
            if diff > now_diff:
                diff = now_diff
                indx = now
            else:
                break
    print(indx)
else:
    print(x)

x, n = list(map(int, input().split()))
p = list(map(int, input().split()))
p = set(p)
diff = 101
indx = 0
ans = (101, 0)
if n != 0:
    for now in range(0, 102):
        if now not in p:
            now_diff = abs(now - x)
            ans = min(ans, (now_diff, now))
    print((ans[1]))
else:
    print(x)

+ans = (101, 0) -            if diff > now_diff: -                diff = now_diff -                indx = now -            else: -                break -    print(indx) +            ans = min(ans, (now_diff, now)) +    print((ans[1]))