H, N = map(int, input().split()) ans = 1 for _ in range(N-1): h = int(input()) if H