#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, int> M;
  bool z = true;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a != 0) z = false;
    M[a]++;
  }
  if (z) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
  }
  if (M.size() == 2) {
    vector<pair<int, int> > V;
    for (auto m : M) {
      V.push_back({m.first, m.second});
    }
    bool z = false;
    int zidx = 0;
    for (int i = 0; i < 2; i++) {
      if (V[i].first == 0) {
        z = true;
        zidx = i;
      }
    }
    if (!z) {
      cout << "No" << endl;
    }
    if (V[zidx].second * 2 == V[zidx ^ 1].second) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (M.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> V;
  for (auto m : M) {
    V.push_back(m.first);
    if (m.second * 3 != N) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((V[0] ^ V[1]) == V[2]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
