#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)(8e18);
const long long int MOD = 1e9 + 7;
vector<int> mp;
map<int, int> Hash;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    Hash[x]++;
    mp.push_back(x);
  }
  sort(mp.begin(), mp.end());
  mp.erase(unique(mp.begin(), mp.end()), mp.end());
  if (n > 3 && (int)mp.size() > 3) {
    cout << "No" << '\n';
    return 0;
  }
  if ((int)mp.size() == 1) {
    if (mp[0] != 0) {
      cout << "No" << '\n';
      return 0;
    }
    cout << "Yes" << '\n';
    return 0;
  }
  if ((int)mp.size() == 3) {
    if (((mp[0] ^ mp[1]) == mp[2] || (mp[1] ^ mp[2]) == mp[0] ||
         (mp[0] ^ mp[2]) == mp[1]) &&
        (Hash[mp[0]] == Hash[mp[1]] && Hash[mp[1]] == Hash[mp[2]])) {
      cout << "Yes" << '\n';
      return 0;
    }
    cout << "No" << '\n';
    return 0;
  }
  cout << "No" << '\n';
}
