N = int(input()) A = list(map(int, input().split())) cum_sum = [0] * (N + 1) for i in range(N): cum_sum[i + 1] = cum_sum[i] + A[i] for i, a in enumerate(A): if a == 0: continue if (cum_sum[-1] - cum_sum[i]) % a: print('No') exit() print('Yes')