#include <bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
using seika = string;
template <class kizuna>
using akari = vector<kizuna>;
template <class yuzuki>
using yukari = akari<akari<yuzuki>>;
template <class tsurumaki>
using maki = akari<yukari<tsurumaki>>;
template <class kotonoha>
using akane = priority_queue<kotonoha, akari<kotonoha>, greater<kotonoha>>;
template <class kotonoha>
using aoi = priority_queue<kotonoha>;
inline void print() { cout << endl; }
template <typename First, typename... Rest>
void print(const First &first, const Rest &...rest) {
  cout << first << ' ';
  print(rest...);
}
void solve() {
  int n;
  cin >> n;
  akari<int> as(n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> as[i];
    mp[as[i]]++;
  }
  if (mp.size() == 1) {
    cout << (mp[0] == n ? "Yes" : "No") << endl;
  } else if (mp.size() == 2) {
    int x = 0;
    for (auto &p : mp) {
      if (p.first) x = p.second;
    }
    cout << ((mp[0] == (n + 1) / 2 || mp[0] == n / 2 || mp[0] == x * 2) ? "Yes"
                                                                        : "No")
         << endl;
  } else if (mp.size() == 3) {
    set<int> s;
    int x = 0;
    for (auto &p : mp) {
      s.insert(p.second);
      x ^= p.first;
    }
    cout << ((x == 0 && s.size() == 1) ? "Yes" : "No") << endl;
  } else {
    cout << "No\n";
  }
}
int main() {
  solve();
  return 0;
}
