#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
bool prime(long long x) {
  for (long long i = 2; i <= sqrt(x); i++) {
    if (x % i == 0) return false;
  }
  return true;
}
long long kai(long long x) {
  if (x == 1) return 1;
  return kai(x - 1) * x % 1000000007;
}
long long mod_pow(long long x, long long y, long long moder) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = res * x % moder;
    x = x * x % moder;
    y >>= 1;
  }
  return res;
}
long long comb(long long x, long long y) {
  if (y > x) return 0;
  if (x == y) return 1;
  return kai(x) * mod_pow(kai(x - y), 1000000007 - 2, 1000000007) % 1000000007 *
         mod_pow(kai(y), 1000000007 - 2, 1000000007) % 1000000007;
}
long long n, a[114514];
bool bl = false;
vector<pair<long long, long long>> ta;
signed main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    bool b = true;
    if (ta.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
    for (long long j = 0; j < ta.size(); j++) {
      if (ta[j].first == a[i]) {
        b = false;
        ta[j].second++;
      }
    }
    if (b) ta.push_back({a[i], 1});
    if (a[i]) bl = true;
  }
  if (!bl)
    cout << "Yes" << endl;
  else if ((n % 3) != 0 || ta.size() != 3 || ta[0].second != ta[1].second ||
           ta[0].second != ta[2].second || ta[1].second != ta[2].second)
    cout << "No" << endl;
  else if ((ta[0].first ^ ta[1].first) != ta[2].first ||
           (ta[0].first ^ ta[2].first) != ta[1].first ||
           (ta[1].first ^ ta[2].first) != ta[0].first)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
