#include <bits/stdc++.h>
using namespace std;
int inf = 100000000;
long long INF = 4000000000000000000;
long long MOD = 1000000007;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int(i) = 0; (i) < (n); (i)++) cin >> a.at(i);
  sort(a.begin(), a.end());
  if (n % 3 == 1) {
    for (int(i) = 0; (i) < (n); (i)++)
      if (a.at(i) != 0) {
        cout << "No" << endl;
        return 0;
      }
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 == 2) {
    for (int(i) = 0; (i) < (n / 3 + 1); (i)++)
      if (a.at(i) != 0) {
        cout << "No" << endl;
        return 0;
      }
    for (int i = n / 3 + 2; i < n; i++) {
      if (a.at(i) != a.at(i - 1)) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  long long p = n / 3;
  for (int i = 1; i < p; i++) {
    if (a.at(i - 1) != a.at(i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = p + 1; i < p * 2; i++) {
    if (a.at(i - 1) != a.at(i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = 2 * p + 1; i < p * 3; i++) {
    if (a.at(i - 1) != a.at(i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (a.at(0) == a.at(p) ^ a.at(2 * p) && a.at(p) == a.at(0) ^ a.at(2 * p) &&
      a.at(2 * p) == a.at(0) ^ a.at(p))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
