#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
map<int, int> mp;
int n, sz, dd[MAXN], mi = 1e9 + 10, ma;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    mi = min(mi, t);
    ma = max(ma, t);
    if (mp[t] == 0) {
      sz++;
    }
    mp[t] += 1;
  }
  if (mi == 0) {
    if (sz > 2) {
      cout << "No";
      return 0;
    }
    cout << "Yes";
    return 0;
  }
  if (sz != 3) {
    cout << "No";
    return 0;
  }
  int t = mi ^ ma;
  if (mp[t]) {
    dd[mp[mi]]++;
    dd[mp[ma]]++;
    dd[mp[t]]++;
    if (n % 3 == 0) {
      if (dd[n / 3] == 3) {
        cout << "Yes";
        return 0;
      }
    }
    if (n % 3 == 1) {
      if (dd[n / 3 + 1] == 1 && dd[n / 3] == 2) {
        cout << "Yes";
        return 0;
      }
    }
    if (n % 3 == 2) {
      if (dd[n / 3 + 1] == 2 && dd[n / 3] == 1) {
        cout << "Yes";
        return 0;
      }
    }
  }
  cout << "No";
}
