#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  map<int, int> mp;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  if (mp.size() == 1 && mp.count(0))
    cout << "YES" << endl;
  else if (n % 3)
    cout << "NO" << endl;
  else if (mp.size() == 2) {
    if (mp[0] == n / 3)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else if (mp.size() == 3) {
    bool good = true;
    int xoor = 0;
    for (auto pr : mp) {
      if (pr.second != n / 3) good = false;
      xoor ^= pr.first;
    }
    if (good && xoor == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else
    cout << "NO" << endl;
}
