#include <bits/stdc++.h>
using namespace std;
typedef struct {
  long long to;
  long long cost;
} Graphs;
const signed INF = (1LL << 30);
const long long MOD = (1e9 + 7);
const long long LINF = (1LL << 60);
const long long LMAX = LLONG_MAX;
void YN(bool b) { cout << (b ? "Yes" : "No") << endl; }
template <class tuple>
inline tuple gcd(tuple a, tuple b) {
  if (b == 0) return a;
  return (gcd(b, a % b));
}
template <class tuple>
inline tuple lcm(tuple a, tuple b) {
  return a / gcd(a, b) * b;
}
template <class tuple>
inline bool chmax(tuple &a, const tuple &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class tuple>
inline bool chmin(tuple &a, const tuple &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class tuple>
tuple center(tuple a, tuple b, tuple c) {
  if ((a <= b && b <= c) || (a >= b && b >= c)) return b;
  if ((b >= a && a >= c) || (b <= a && a <= c)) return a;
  return c;
}
void print() { cout << endl; }
template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail) {
  cout << head << ", ";
  print(forward<Tail>(tail)...);
}
void input() {}
template <class Head, class... Tail>
void input(Head &&head, Tail &&...tail) {
  cin >> head;
  input(forward<Tail>(tail)...);
}
template <typename tuple>
ostream &operator<<(ostream &out, const vector<tuple> &v) {
  if (!v.empty()) {
    copy(v.begin(), v.end(), ostream_iterator<tuple>(out, ", "));
    out << "\b\b";
  }
  return out;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << p.first << ", " << p.second;
  return out;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  long long n;
  cin >> n;
  map<long long, long long> x;
  vector<long long> a(n);
  for (long long i = 0; i < (n); ++i) {
    cin >> a[i];
    x[a[i]]++;
  }
  sort(a.begin(), a.end());
  if (a[0] == a[n - 1] && a[n - 1] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if ((signed)(x.size()) > 3) {
    cout << "No" << endl;
    return 0;
  }
  if ((signed)(x.size()) == 2) {
    long long cnt = 0;
    for (long long i = 0; i < (n); ++i) cnt += (a[i] == a[n - 1]);
    if (cnt == 2 * n / 3 && a[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if ((signed)(x.size()) == 3) {
    auto itr = x.begin();
    auto aa = *(itr);
    itr++;
    auto bb = *(itr);
    itr++;
    auto cc = *(itr);
    if (aa.second == bb.second && bb.second == cc.second &&
        aa.second == n / 3) {
      if ((aa.first ^ bb.first ^ cc.first) == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else
      cout << "No" << endl;
  }
  return 0;
}
