N = int(input())
a = list(map(int,input().split()))
if N % 3:
  print('No')
else:
  a.sort()
  M = N//3
  if a[0]^a[M]^a[2*M] != 0:
    print('No')
  else:
    for i in range(N):
      if a[i] != a[(i//M)*M]:
        print('No')
        break
    else:
      print('Yes')