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