#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
template <class T>
inline void chmax(T &a, const T &b) {
  if ((a) < (b)) (a) = (b);
}
template <class T>
inline void chmin(T &a, const T &b) {
  if ((a) > (b)) (a) = (b);
}
template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
long long solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  set<long long> s;
  map<long long, long long> d;
  for (long long i = (long long)(0); i < (long long)(n); ++i) {
    cin >> a[i];
    s.insert(a[i]);
    d[a[i]]++;
  }
  42;
  if (((long long)(s).size()) >= 4) {
    cout << "No" << endl;
    return 0;
  } else if (((long long)(s).size()) == 1 and a[0] == 0) {
    cout << "Yes" << endl;
    return 0;
  } else if (((long long)(s).size()) == 1) {
    cout << "No" << endl;
    return 0;
  } else if (((long long)(s).size()) == 2) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (d[0] != n / 3) {
      cout << "No" << endl;
      return 0;
    }
    if (d[0] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (((long long)(s).size()) == 3) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    vector<long long> x;
    for (auto &&el : s) {
      x.push_back(el);
      if (d[el] != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    long long p, q, r;
    p = x[0];
    q = x[1];
    r = x[2];
    if ((p ^ q) == r) {
      cout << "Yes" << endl;
      return 0;
    }
    if ((p ^ r) == q) {
      cout << "Yes" << endl;
      return 0;
    }
    if ((q ^ r) == p) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
  }
  assert(false);
  return 0;
}
signed main() {
  solve();
  return 0;
}
