#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
map<int, int> ss;
int n, x;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    ss[x]++;
  }
  int sz = ss.size();
  if (n % 3) {
    printf((sz == 1 && (ss.count(0))) ? "YES\n" : "NO\n");
  } else {
    if (sz != 3) return !printf("NO\n");
    auto it = ss.begin();
    int a = it->first, aa = it->second;
    ++it;
    int b = it->first, bb = it->second;
    ++it;
    int c = it->first, cc = it->second;
    if (!(aa == bb && bb == cc)) return !printf("NO\n");
    if (a ^ b != c) return !printf("NO\n");
    printf("YES\n");
  }
}
