#include <bits/stdc++.h>
using namespace std;
const int N = (int)(1e6 + 5);
const int LOG = (int)(20);
long long int n, ar[N];
map<long long int, long long int> mpx;
vector<long long int> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
    mpx[ar[i]]++;
  }
  if (mpx.size() >= 4) {
    cout << "No";
    return 0;
  }
  if (mpx.size() == 1) {
    if (mpx[0] >= 1) {
      cout << "Yes";
      return 0;
    } else {
      cout << "No";
      return 0;
    }
  }
  sort(ar + 1, ar + n + 1);
  if (mpx.size() == 2) {
    if (ar[1] == 0 && mpx[0] * 2 == mpx[ar[n]]) {
      cout << "Yes";
      return 0;
    } else {
      cout << "No";
      return 0;
    }
  }
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  if (mpx.size() == 3) {
    for (auto i : mpx) {
      if (i.second != n / 3) {
        cout << "No";
        return 0;
      }
      v.push_back(i.first);
    }
    if (v[0] ^ v[1] == v[2]) {
      cout << "Yes";
      return 0;
    } else {
      cout << "No";
      return 0;
    }
  }
}
