#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
  os << '(' << a.first << ',' << a.second << ')';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> v) {
  for (auto x : v) os << x << ' ';
  return os;
}
void debug() { cerr << '\n'; }
template <typename H, typename... T>
void debug(H a, T... b) {
  cerr << a;
  if (sizeof...(b)) cerr << ", ";
  debug(b...);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); ++i) cin >> a[i];
  map<int, int> mp;
  for (int x : a) mp[x]++;
  if (mp.size() == 1) {
    if (mp[0] == n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() > 3) {
    cout << "No" << endl;
  } else if (mp.size() == 3) {
    vector<pii> b;
    for (auto x : mp) b.emplace_back(x);
    if (b[0].second == b[1].second and b[1].second == b[2].second and
        b[2].second == b[0].second and
        b[0].first ^ b[1].first ^ b[2].first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    vector<pii> b;
    for (auto x : mp) b.emplace_back(x);
    assert(false);
    if (b[0].second * 2 == b[1].second and b[0].first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
