#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1001001001001001LL;
const long long int MOD = 1000000007;
long long int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
long long int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};
signed main() {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int cnt0 = 0;
  for (long long int i = 0; i < n; i++) {
    cnt0 += (a[i] == 0);
  }
  if (cnt0 == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cerr << 3 << endl;
    cout << "No" << endl;
    return 0;
  }
  map<long long int, long long int> mp;
  for (long long int i = 0; i < n; i++) mp[a[i]]++;
  ;
  if (mp.size() != 3) {
    cerr << 51 << endl;
    cout << "No" << endl;
    return 0;
  }
  long long int val = n / 3;
  for (auto x : mp) {
    if (x.second != val) {
      cerr << 60 << endl;
      cout << "No" << endl;
      return 0;
    }
  }
  bool flag = false;
  vector<long long int> b;
  for (auto x : mp) b.push_back(x.first);
  sort(b.begin(), b.end());
  do {
    if ((b[0] ^ b[2]) == b[1] and (b[1] ^ b[0]) == b[2] and
        (b[2] ^ b[1]) == b[0])
      flag = true;
  } while (next_permutation(b.begin(), b.end()));
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
