#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;
const int IINF = (1 << 30) - 1;
const long long LLINF = 1LL << 61;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1},
          dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;
template <typename T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T &a, T b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
bool solve(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0, i_len = int(n); i < i_len; ++i) {
    cin >> a[i];
  }
  sort((a).begin(), (a).end());
  if (n % 3 == 0) {
    for (int i = 0, i_len = int(n / 3); i < i_len; ++i) {
      if (a[i] != a[0]) {
        return false;
      }
    }
    for (int i = (n / 3), i_len = int((n * 2) / 3); i < i_len; ++i) {
      if (a[i] != a[n / 3]) {
        return false;
      }
    }
    for (int i = ((n * 2) / 3), i_len = int(n); i < i_len; ++i) {
      if (a[i] != a[n - 1]) {
        return false;
      }
    }
    vector<int> v = {a[0], a[n / 3], a[n - 1]};
    do {
      if (v[0] ^ v[1] == v[2] && v[1] ^ v[2] == v[0] && v[2] ^ v[0] == v[1]) {
        return true;
      }
    } while (next_permutation(v.begin(), v.end()));
    return false;
  } else {
    for (int i = 0, i_len = int(n); i < i_len; ++i) {
      if (a[i] != a[0]) {
        return false;
      }
    }
    if (a[0] != 0) {
      return false;
    }
  }
  return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  if (solve()) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
