#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> ma;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ma[a[i]]++;
  }
  if (ma.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  int cnt0 = count(a.begin(), a.end(), 0);
  if (cnt0 == n) {
    cout << "Yes" << endl;
    return 0;
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  } else {
    if ((cnt0 == n / 3 && ma.size() == 2) ||
        (cnt0 == 2 * n / 3 && ma.size() == 2)) {
      cout << "Yes" << endl;
      return 0;
    }
    if (ma.size() <= 3) {
      if (a[0] == (a[1] ^ a[2]) && a[1] == (a[2] ^ a[0]) &&
          a[2] == (a[0] ^ a[1])) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}
