@staticmethod
def c():
    (x, n, *p) = map(int, sys.stdin.read().split())
    a = list((set(range(102)) - set(p)))
    a = [(abs((y - x)), y) for y in a]
    print(sorted(a)[0][1])
@staticmethod
def c():
    (x, n, *p) = map(int, sys.stdin.read().split())
    a = list((set(range(102)) - set(p)))
    a = [(abs((y - x)), y) for y in a]
    print(sorted(a)[0][1])