#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("-Ofast", "-funroll-all-loops", "-ffast-math")
using namespace std;
using LL = long long;
mt19937 dlsrand(random_device{}());
mt19937 mrand(std::chrono::system_clock::now().time_since_epoch().count());
int rnd(int x) { return mrand() % x; }
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
LL bin(LL x, LL n, LL MOD) {
  LL ret = MOD != 1;
  for (x %= MOD; n; n >>= 1, x = x * x % MOD)
    if (n & 1) ret = ret * x % MOD;
  return ret;
}
inline LL get_inv(LL x, LL p) { return bin(x, p - 2, p); }
const double PI = acos(-1.0);
constexpr int maxn = 1e6 + 10;
constexpr int mod = 1e9 + 7;
constexpr int INF = 0x3f3f3f3f;
constexpr long long linf = 0x3f3f3f3f3f3f3f3f;
constexpr unsigned long long base = 2333, P_1 = 19260811, P_2 = 999998639;
void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
void dec(int &a, int b) {
  a -= b;
  if (a < 0) a += mod;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp.size() == 1) {
    cout << (mp.count(0) ? "Yes" : "No") << endl;
    return 0;
  }
  if (mp.size() == 2) {
    if (n % 3 != 0) return cout << "No\n", 0;
    if (mp[0] * 2 == mp[1] && (*mp.begin()).first == 0)
      cout << "Yes\n";
    else
      cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 3) {
    map<int, int>::iterator it1 = mp.begin();
    map<int, int>::iterator it2 = ++mp.begin();
    map<int, int>::iterator it3 = mp.end();
    if (mp[1] == mp[0] && mp[1] == mp[2] &&
        ((*it1).first ^ (*it2).first == (*it3).first)) {
      return cout << "Yes" << endl, 0;
    }
  }
  cout << "No";
}
