#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    m[a]++;
  }
  if (m.size() == 1) {
    auto itr = m.begin();
    if (itr->first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  if (m.size() == 2) {
    auto itr = m.begin();
    if (itr->first == 0 && itr->second == n / 3 && n % 3 == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  if (m.size() == 3) {
    auto itr = m.begin();
    ll a = itr->first;
    int sizea = itr->second;
    itr++;
    ll b = itr->first;
    int sizeb = itr->second;
    itr++;
    ll c = itr->first;
    int sizec = itr->second;
    if (sizea == sizeb && sizea == sizec && a ^ b ^ c == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  if (m.size() >= 4) cout << "No" << endl;
}
