from itertools import accumulate from collections.abc import Iterable def accum_dp(xs: Iterable, f, op, e, init: dict, *, is_reset=True): dp = init.copy() for x in xs: pp = {} if is_reset else dp.copy() dp, pp = pp, dp for fm_key, fm_val in pp.items(): for to_key, to_val in f(fm_key, fm_val, x): dp[to_key] = op(dp.get(to_key, e), to_val) return dp def f(k, v, x): yield k, v yield k ^ x, v + 1 def op(a, b): return min(a, b) def solve(): if N > 5001: return True s = 0 for a in A: s ^= a if s != 0: return False if A.count(0) > 0: return True init = {A[0]: 1} dp = accum_dp(A[1:], f, op, INF, init) res = dp.get(0, INF) return res < N INF = 1 << 62 N = int(input()) A = list(map(int, input().split())) ans = solve() if ans: print('Yes') else: print('No')