N = int(input())
a = [int(i) for i in input().split()]
flag = True
for i in range(N-1):
  if(a[-1+i]^a[i+1] != a[i]):
    flag = False
    break;
if(a[N-2]^a[0] != a[N-1]):
  flag = False
if(flag):
  print("Yes")
else:
  print("No")
    
