#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class C>
void mini(C &a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C &a4, C b4) {
  a4 = max(a4, b4);
}
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  if (0) cout << fixed << setprecision(6);
  long long n;
  cin >> n;
  map<long long, long long> mapka;
  vector<long long> roz;
  for (long long i = (0); i <= ((long long)(n)-1); i++) {
    long long pom;
    cin >> pom;
    if (mapka[pom] == 0) {
      roz.push_back(pom);
    }
    mapka[pom]++;
  }
  if (((long long)(roz).size()) == 1) {
    cout << "Yes\n";
    return 0;
  }
  if (n % 3 == 0 && ((long long)(roz).size()) == 3 &&
      (roz[0] ^ roz[1] ^ roz[2]) == 0) {
    for (pair<long long, long long> el : mapka) {
      if (el.second != n / 3) {
        cout << "No\n";
        return 0;
      }
    }
    cout << "Yes\n";
    return 0;
  }
  cout << "No\n";
}
