#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if ((int)mp.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if ((int)mp.size() == 1) {
    cout << "No" << endl;
    return 0;
  }
  mp.erase(0);
  if (n % 3 == 0) {
    vector<pair<int, int> > v;
    for (auto e : mp) {
      v.emplace_back(pair<int, int>(e.first, e.second));
    }
    if ((int)mp.size() == 2) {
      if (v[0].second == n / 3 && v[1].second == 2 * n / 3) {
        cout << "Yes" << endl;
        return 0;
      }
      cout << "No" << endl;
      return 0;
    }
    if ((v[0].first ^ v[1].first) != v[1].first &&
        (v[2].first ^ v[1].first) != v[0].first &&
        (v[0].first ^ v[2].first) != v[1].first) {
      cout << "No" << endl;
      return 0;
    }
    if (v[0].second == v[1].second && v[1].second == v[2].second) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
}
