#include <bits/stdc++.h>
using namespace std;
template <typename T>
using v = vector<T>;
template <typename T>
using pq = priority_queue<T>;
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename K>
using ump = unordered_map<T, K>;
const long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const long long mod = 1000000007;
const long long inf = long long(1e9);
const long long e5 = long long(1e5);
const long long ll_inf = long long(1e9) * long long(1e9);
template <class T>
void dump_debug(T list) {}
inline long long inl() {
  long long x;
  cin >> x;
  return x;
}
inline string ins() {
  string x;
  cin >> x;
  return x;
}
int main() {
  long long n = inl();
  vector<long long> a(n);
  map<long long, long long> mp;
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (n % 3 == 0) {
    if (mp.size() == 3) {
      vector<long long> tmp;
      for (auto& e : mp) {
        if (e.second != n / 3) {
          cout << "No" << endl;
          return 0;
        }
        tmp.emplace_back(e.first);
      }
      if ((tmp[0] ^ tmp[1] ^ tmp[2]) == 0) {
        cout << "Yes" << endl;
        return 0;
      }
      cout << "No" << endl;
    } else if (mp.size() == 2) {
      if (mp[0] == n / 3 && ++mp.begin()->second == 2 * n / 3) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      if (mp[0] == n)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  } else {
    if (mp[0] == n)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
