#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
const long double eps = 1e-10;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<int, int> mp;
  vector<long long> A(n);
  for (int i = (int)(0); i < (int)(n); i++) {
    cin >> A[i];
    mp[A[i]]++;
  }
  if (n % 3 == 0) {
    if (mp.size() > 3)
      cout << "No" << '\n';
    else if (mp.size() == 3) {
      bool ok = true;
      long long sum = 0;
      for (auto ele : mp) {
        sum ^= ele.first;
        if (ele.second != n / 3) ok = false;
      }
      if (ok && sum == 0)
        cout << "Yes" << '\n';
      else
        cout << "No" << '\n';
    } else if (mp.size() == 2) {
      if (mp.count(0) && mp[0] == n / 3 * 2)
        cout << "Yes" << '\n';
      else
        cout << "No" << '\n';
    } else {
      if (mp.count(0))
        cout << "Yes" << '\n';
      else
        cout << "No" << '\n';
    }
  } else {
    if (mp.size() == 1 && mp.count(0))
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
  }
  return 0;
}
