#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 10;
const long long MOD = 1e9 + 7;
int a[N];
vector<int> v;
map<int, int> qan;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int n;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    qan[a[i]]++;
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  if (n % v.size()) {
    cout << "No" << endl;
    return 0;
  }
  if (v.size() == 1) {
    if (v[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (v.size() == 3) {
    if (v[0] ^ v[1] == v[2] && qan[v[0]] == qan[v[1]] &&
        qan[v[1]] == qan[v[2]]) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
