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

 

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

 

import sys

for i in range(200):

 

    if X-i not in p:

        print((X-i))

        sys.exit()

    elif X+i not in p:

        print((X+i))

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

 

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

 

import sys

for i in range(102):

 

    if X-i not in p:

        print((X-i))

        sys.exit()

    elif X+i not in p:

        print((X+i))

        sys.exit()
X, N = list(map(int, input().split()))
p = list(map(int, input().split()))
import sys

for i in range(200):
    if X - i not in p:
        print((X - i))
        sys.exit()
    elif X + i not in p:
        print((X + i))
        sys.exit()

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

for i in range(102):
    if X - i not in p:
        print((X - i))
        sys.exit()
    elif X + i not in p:
        print((X + i))
        sys.exit()

-for i in range(200): +for i in range(102):