#include <bits/stdc++.h>
using namespace std;
bool check(map<long long, long long> m, long long n) {
  if (n % 3 != 0) return false;
  if (m.size() != 3) return false;
  vector<long long> v;
  for (auto it : m) {
    if (it.second != n / 3) return false;
    v.push_back(it.first);
  }
  if (v[0] ^ v[1] ^ v[2] != 0) return false;
  return true;
}
bool check2(map<long long, long long> m, long long n) {
  if (m.size() != 2) return false;
  vector<long long> v;
  for (auto it : m) {
    v.push_back(it.first);
  }
  if (m[v[0]] == (2 * n) / 3 && m[v[1]] == n / 3 ||
      m[v[1]] == (2 * n) / 3 && m[v[0]] == n / 3)
    return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  map<long long, long long> m;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  sort(a, a + n);
  if (a[0] == a[n - 1] && a[0] == 0) return cout << "Yes", 0;
  ;
  long long aa = check(m, n);
  long long ba = check2(m, n);
  if (aa || ba) return cout << "Yes", 0;
  ;
  return cout << "No", 0;
  ;
}
