#include <bits/stdc++.h>
using namespace std;
struct fast_ios {
  fast_ios() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  };
} fast_ios_;
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (auto &x : v) is >> x;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i];
    if (i != v.size() - 1) cout << endl;
  };
  return os;
}
template <typename T>
void Out(T x) {
  cout << x << endl;
}
template <typename T1, typename T2>
void Ans(bool first, T1 y, T2 n) {
  if (first)
    Out(y);
  else
    Out(n);
}
using vec = vector<long long>;
using mat = vector<vec>;
using Pii = pair<long long, long long>;
using PiP = pair<long long, Pii>;
using PPi = pair<Pii, long long>;
using bools = vector<bool>;
using pairs = vector<Pii>;
const long long mod = 1000000007;
signed main() {
  long long N;
  cin >> N;
  vec a(N);
  cin >> a;
  map<long long, long long> m;
  for (long long i = (0); i < (N); i++) m[a[i]] += 1;
  bool first = false;
  pairs v;
  for (auto p : m) v.push_back(p);
  if (((long long)v.size()) == 1) {
    if (v[0].first == 0) first = true;
  } else if (((long long)v.size()) == 2) {
    if (v[0].first == 0 && v[1].second == v[0].second * 2) first = true;
    if (v[1].first == 0 && v[0].second == v[1].second * 2) first = true;
  } else if (((long long)v.size()) == 3) {
    if ((v[0].first ^ v[1].first == v[2].first) && v[0].second == v[1].second &&
        v[1].second == v[2].second)
      first = true;
  }
  Ans(first, "Yes", "No");
  return 0;
}
