import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,M,*A = map(int,read().split()) card = list(range(1,N+1)) for x in A: x -= 1 c = card[x] del card[x] card = [c] + card print(card[0])