#include <bits/stdc++.h>
using namespace std;
inline void prep() {
  cin.tie(0);
  cin.sync_with_stdio(0);
};
const double pi = acos(-1.);
int mod = 1000000007;
long long mymod(long long num) {
  if (num < 0 && !(abs(num) % mod == 0)) {
    if (mod == 1) {
      return 0;
      ;
    }
    return mod - abs(num) % mod;
  } else {
    return num % mod;
  }
}
double eps = .000000001;
int main() {
  prep();
  int n;
  cin >> n;
  int arr[n];
  map<int, int> cnts;
  int nonzero = 0;
  set<int> ones;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] != 0) {
      nonzero++;
    }
    ones.insert(arr[i]);
    auto findd = cnts.find(arr[i]);
    if (findd == cnts.end()) {
      cnts[arr[i]] = 1;
    } else {
      int val = findd->second + 1;
      cnts[arr[i]] = val;
    }
  }
  if (n % 3 != 0) {
    if (nonzero > 0) {
      cout << "NO";
    } else {
      cout << "YES";
    }
    return 0;
  }
  int mult = n / 3;
  int curxor = 0;
  for (int i : ones) {
    curxor ^= i;
  }
  if (curxor != 0) {
    cout << "NO";
    return 0;
  }
  for (int i : ones) {
    if (cnts.find(i)->second % mult != 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
