#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  return a = (a < b) ? b : a;
}
template <class T>
inline bool chmin(T& a, T b) {
  return a = (a > b) ? b : a;
}
long long const INF = 1LL << 60;
long long const MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ;
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (long long i = 0; i < (N); i++) cin >> a[i];
  map<long long, long long> cnt;
  for (long long i = 0; i < (N); i++) {
    cnt[a[i]]++;
  }
  if (((int)(cnt).size()) == 1) {
    auto it = cnt.begin();
    if (it->first != 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
    return 0;
  } else if (((int)(cnt).size()) == 2) {
    bool flg = true;
    for (auto e : cnt) {
      if (!((e.second == N / 3 && e.first == 0) || (e.second == 2 * N / 3)))
        flg = false;
    }
    if (flg) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  } else if (((int)(cnt).size()) == 3) {
    vector<long long> b(3);
    long long i = 0;
    bool flg = true;
    for (auto e : cnt) {
      if (e.second == N / 3) {
        b[i] = e.first;
      } else {
        cout << "No" << endl;
        return 0;
      }
      i++;
    }
    if (b[0] ^ b[2] == b[1] && b[1] ^ b[0] == b[2] && b[2] ^ b[1] == b[0]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (((int)(cnt).size()) > 3) {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
