from functools import reduce
n = int(input())
l = list(map(int, input().split()))
if n%3:
  if max(l) == 0:
    print("YES")
  else:
    print("NO")
else:
  if reduce((lambda x, y:x ^ y), l) == 0:
    print("YES")
  else:
    print("NO")