n = int(input())
a = list(map(int,input().split()))
#n = 9
#a = [1,2,3,1,2,3,1,2,3]
if n >=4:
  if n % 3 != 0:
    if a.count(0) == n:
      print("Yes")
    else :
      print("No")
  else:
    s = set(a)
    if len(s)!=3:
      print("No")
    else:
      l = list(s)
      if (l[0]^l[1] == l[2] and l[1]^l[2] == l[0] and l[2]^l[0] == l[1]) and (a.count(l[0])==n/3 and a.count(l[1])==n/3 and a.count(l[2])==n/3):
        print("Yes")
      else:
        print("No")
else:
  if a[0]^a[1] == a[2] and a[1]^a[2] == a[0] and a[2]^a[0] == a[1]:
    print("Yes")
  else:
    print("No")