#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N;
  cin >> N;
  ll a;
  map<ll, int> c;
  for (int i = 0; i < N; i++) {
    cin >> a;
    c[a]++;
  }
  vector<ll> k, n;
  for (auto p : c) {
    k.push_back(p.first);
    n.push_back(p.second);
  }
  if (k.size() == 1) {
    if (k[0] != 0) {
      cout << "No"
           << "\n";
      return 0;
    } else {
      cout << "Yes"
           << "\n";
      return 0;
    }
  } else if (k.size() == 2) {
    if (k[0] == 0) {
      if (n[0] == 2 * n[1]) {
        cout << "Yes"
             << "\n";
        return 0;
      } else {
        cout << "No"
             << "\n";
        return 0;
      }
    } else if (k[1] == 0) {
      if (n[1] == 2 * n[0]) {
        cout << "Yes"
             << "\n";
        return 0;
      } else {
        cout << "No"
             << "\n";
        return 0;
      }
    } else {
      cout << "No"
           << "\n";
      return 0;
    }
  } else if (k.size() == 3) {
    if (k[0] ^ k[1] != k[2] || n[0] != n[1] || n[1] != n[2] || n[2] != n[0]) {
      cout << "No"
           << "\n";
      return 0;
    }
    cout << "Yes"
         << "\n";
    return 0;
  } else {
    cout << "No"
         << "\n";
    return 0;
  }
}
