#include <bits/stdc++.h>
using namespace std;
mt19937 gen(time(nullptr));
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  map<long long, long long> a;
  vector<long long> inp(n);
  for (long long i = 0; i < n; ++i) {
    long long now;
    cin >> now;
    a[now]++;
    inp[i] = now;
  }
  sort(inp.begin(), inp.end());
  if (a.size() == 1) {
    if (a.find(0) != a.end()) {
      cout << "Yes\n";
    } else
      cout << "No\n";
    return 0;
  }
  if (a.size() > 3) {
    cout << "No\n";
    return 0;
  }
  long long res = a.begin()->second;
  if (a.size() == 3) {
    for (auto now : a) {
      if (now.second != res) {
        cout << "No\n";
        return 0;
      }
    }
    set<long long> used;
    for (auto now : a) {
      (used.insert(now.first));
    }
    vector<long long> b;
    for (long long i : used) b.push_back(i);
    if (b[0] ^ b[1] != b[2]) {
      cout << "No\n";
      return 0;
    }
    cout << "Yes\n";
  } else {
    set<long long> used;
    for (auto now : a) used.insert(now.first);
    vector<long long> b;
    for (long long i : used) b.push_back(i);
    sort(b.begin(), b.end());
    if (b[0] != 0) {
      cout << "No\n";
      return 0;
    }
    if (a[0] * 2 != a[b[1]]) {
      cout << "No\n";
      return 0;
    }
    long long cnt = 0;
    for (long long i : inp)
      if (!i) ++cnt;
    set<long long> cc;
    for (long long i : inp) cc.insert(i);
    assert(n % 3 == 0 && inp[0] == 0 && cnt * 3 == n && a.size() == 2 &&
           cc.size() == 2);
    if (n < (long long)1e8) cout << "Yes\n";
  }
  return 0;
}
