#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x;
  std::sort(a.begin(), a.end());
  int k = 0, t = a[0];
  vector<int> b(3), c(3);
  for (auto &x : a) {
    if (t != x) k++, t = x;
    if (k >= 3) {
      cout << "No" << endl;
      return 0;
    }
    c[k] = x;
    b[k]++;
  }
  if (k == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (k == 1) {
    if (c[0] == 0 && abs(b[0] - b[1]) <= 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (c[0] ^ c[1] != c[2]) {
    cout << "No" << endl;
    return 0;
  }
  if (b[0] == b[1] && b[1] == b[2]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
