#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const int dx[4] = {+1, 0, -1, 0};
const int dy[4] = {0, -1, 0, +1};
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  unordered_map<ll, ll> mp;
  ll zero = 0;
  for (int i = 0; i < n; i++) {
    ll a;
    cin >> a;
    if (a == 0)
      zero++;
    else
      mp[a]++;
  }
  if (zero == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (!(n % 3) && mp.size() == 1) {
    auto top = mp.begin();
    if (top->second == n) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (!(n % 3) && mp.size() == 3) {
    ll sum = 0;
    bool ok = true;
    for (auto m : mp) {
      sum ^= m.first;
      if (m.second != n / 3) {
        ok = false;
        break;
      }
    }
    if (ok) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
