#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const long double PI = acos(-1);
constexpr long double EPS = 1e-15;
constexpr int inf = 2e9;
constexpr ll INF = 2e18;
constexpr ll MOD = 1e9 + 7;
constexpr ll MOD1 = 998244353;
int a[100010];
void solve() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp.size() == 1 && a[0] == 0) {
    cout << "Yes" << endl;
    return;
  }
  if (mp.count(0)) {
    if (mp.size() != 2) {
      cout << "No" << endl;
      return;
    }
    map<int, int>::iterator itr = mp.begin();
    int a = (*itr).second;
    int aa = (*itr).first;
    itr++;
    int b = (*itr).second;
    int bb = (*itr).first;
    if (((a == b * 2) && (bb == 0)) || ((b == a * 2) && (aa == 0))) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return;
  }
  if (mp.size() != 3) {
    cout << "No" << endl;
    return;
  }
  bool f = 1;
  map<int, int>::iterator itr = mp.begin();
  int a = (*itr).second;
  int aa = (*itr).first;
  itr++;
  int b = (*itr).second;
  int bb = (*itr).first;
  itr++;
  int c = (*itr).second;
  int cc = (*itr).first;
  f &= (a == b) && (b == c);
  f &= (aa ^ bb == cc) || (aa ^ cc == bb) || (bb ^ cc == aa);
  if (f) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
int main(int argc, char *argv[]) {
  int case_num = 1;
  if (argc > 1 && stoi(argv[1])) cin >> case_num;
  for (int case_no = (0); case_no < (case_num); case_no++) {
    cerr << endl << "case " << case_no + 1 << endl;
    solve();
  }
  return 0;
}
