#include <bits/stdc++.h>
using namespace std;
constexpr int kMod = 1000000007;
template <typename T>
istream& operator>>(istream& is, vector<T>& vs) {
  for (T& v : vs) is >> v;
  return is;
}
int main() {
  int N;
  cin >> N;
  map<int, int> m;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    m[a]++;
  }
  vector<int> keys;
  for (auto [k, v] : m) {
    keys.push_back(k);
  }
  sort(keys.begin(), keys.end());
  if (keys.size() == 1 && keys[0] == 0) {
    cout << "Yes" << endl;
  } else if (N % 3 != 0) {
    cout << "No" << endl;
  } else if (keys.size() == 2) {
    if (keys[0] == 0 && m[keys[0]] == N / 3 && m[keys[1]] == 2 * N / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (keys.size() == 3) {
    if (m[keys[0]] == N / 3 && m[keys[1]] == N / 3 && m[keys[2]] == N / 3 &&
        (keys[0] ^ keys[1] ^ keys[2] == 0)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
