#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long long INF = 1e9 + 47;
const long long LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 1 << 17;
int n;
int a[N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = (0); i < (n); ++i) cin >> a[i];
  sort(a, a + n);
  if (n % 3) {
    if (a[n - 1] == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  bool ok = 1;
  n /= 3;
  for (int j = (0); j < (3); ++j)
    for (int i = (0); i < (n); ++i) ok &= a[j * n + i] == a[j * n];
  if (ok && ((a[0] ^ a[n] ^ a[2 * n]) == 0))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
  return 0;
}
