#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i;
  cin >> n;
  vector<long long> v;
  unordered_map<long long, long long> mp;
  long long m;
  for (i = 0; i < n; i++) {
    cin >> m;
    mp[m]++;
    if (mp[m] == 1) v.push_back(m);
  }
  if (n % 3 != 0 || v.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  sort(v.begin(), v.end());
  if (v[0] == 0 && v.size() > 2) {
    cout << "No" << endl;
    return 0;
  } else if (v[0] == 0 && v.size() <= 2) {
    if (v.size() == 1)
      cout << "Yes" << endl;
    else if (v.size() == 2) {
      if (mp[0] == n / 3 && mp[v[1]] == (2 * n) / 3)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
    return 0;
  } else if (v[0] != 0) {
    if (v.size() != 3)
      cout << "No" << endl;
    else {
      if ((v[0] ^ v[1] == v[2]) &&
          (mp[v[0]] == n / 3 && mp[v[1]] == n / 3 && mp[v[2]] == n / 3))
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
    return 0;
  }
}
