#include <bits/stdc++.h>
using namespace std;
using PII = pair<int, int>;
using LL = long long;
map<int, int> mp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (mp.find(x) != mp.end())
      mp[x]++;
    else
      mp[x] = 1;
  }
  int siz = mp.size();
  if (mp.find(0) != mp.end()) siz--;
  vector<int> v;
  int zero = 0;
  if (mp.find(0) != mp.end()) zero = mp[0];
  for (auto p : mp) {
    if (p.first != 0) v.push_back(p.second);
  }
  sort(v.begin(), v.end());
  if (siz == 3) {
    vector<int> vv;
    for (auto p : mp) {
      if (p.first != 0) vv.push_back(p.first);
    }
    if (vv[0] ^ vv[1] != vv[2]) {
      cout << "No\n";
    } else if (v[0] == v[1] && v[0] == v[2]) {
      if (zero == 0)
        cout << "Yes\n";
      else
        cout << "No\n";
    } else {
      int x = min((v[1] - v[0]) / 2, zero);
      v[1] -= x;
      zero -= x;
      x = min((v[2] - v[1]) / 2, zero);
      v[2] -= x;
      zero -= x;
      if (v[0] == v[1] && v[0] == v[2]) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    }
  } else if (siz == 1) {
    if (v[0] > zero + 1)
      cout << "No\n";
    else
      cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
