#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> xs(n);
  for (int& x : xs) {
    cin >> x;
  }
  if (n % 3 != 0) {
    for (int x : xs) {
      if (x != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  sort(xs.begin(), xs.end());
  for (int j = 0; j < 3; ++j) {
    if (xs[j * n / 3] != xs[(j + 1) * n / 3 - 1]) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (xs[0] ^ xs[n / 3] ^ xs[2 * n / 3] == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
