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