#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int M = 100111;
const int inf = 1000000007;
const long long INF = 1e18;
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
int ddx[8] = {1, -1, 0, 0, 1, -1, -1, 1}, ddy[8] = {0, 0, 1, -1, 1, -1, 1, -1};
int main() {
  int n, a;
  cin >> n;
  map<int, int> cnt;
  for (int i = 0; i < n; i++) cin >> a, cnt[a]++;
  if (cnt[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> all;
  for (auto& v : cnt) {
    for (int i = 0; i < v.second / (n / 3); i++) {
      all.push_back(v.first);
    }
  }
  if (all.size() == 3 && all[0] ^ all[1] ^ all[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
