#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printlnVector(T v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    cout << v[i] << endl;
  }
}
template <typename T>
void printVector(T v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  map<int, int> count;
  for (int i = 0; i < (int)(N); i++) {
    cin >> a[i];
    count[a[i]]++;
  }
  sort(a.begin(), a.end());
  ;
  bool is_ok = true;
  if (count.size() == 1) {
    if (a[0] != 0) is_ok = false;
  } else if (count.size() == 2) {
    if (2 * count[a[0]] != count[a[N - 1]] || a[0] != 0) is_ok = false;
  } else if (count.size() == 3) {
    vector<int> num;
    for (pair<int, int> P : count) {
      if (P.second != count.begin()->second) is_ok = false;
      num.push_back(P.first);
    }
    if (num[0] xor num[1] != num[2]) is_ok = false;
  } else
    is_ok = false;
  if (is_ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
