#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vi a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  map<int, int> mp;
  for (int i = 0; i < (int)(n); i++) mp[a[i]]++;
  bool ans = false;
  if ((int)(mp).size() == 0 && a[0] == 0) {
    ans = true;
  } else if (n % 3 == 0 && (int)(mp).size() == 2) {
    for (auto p : mp)
      if (p.first == 0 && p.second == 1 * n / 3) ans = true;
  } else if (n % 3 == 0 && (int)(mp).size() == 3) {
    vp x;
    for (auto p : mp) x.emplace_back(p.first, p.second);
    if ((x[0].first ^ x[1].first ^ x[2].first) == 0 && x[0].second == n / 3 &&
        x[1].second == n / 3)
      ans = true;
  }
  cout << (ans ? "Yes" : "No") << endl;
}
