#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = (0), i_len = (n); i < i_len; ++i) cin >> a[i];
  if (all_of((a).begin(), (a).end(), [&](int x) { return x == a[0]; })) {
    cout << "Yes\n";
  } else if (n % 3 != 0) {
    cout << "No\n";
  } else {
    map<int, int> m;
    for (int i = (0), i_len = (n); i < i_len; ++i) m[a[i]]++;
    if (m.size() == 3) {
      bool ok = true;
      vector<int> b;
      for (auto p : m) {
        if (p.second != n / 3) ok = false;
        b.push_back(p.first);
      }
      if (ok && ((b[0] ^ b[1] == b[2]) || (b[0] ^ b[2] == b[1]) ||
                 (b[1] ^ b[2] == b[0]))) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    } else if (m.size() == 2) {
      bool ok = true;
      for (auto p : m) {
        if (p.second == n / 3 && p.first != 0)
          ok = false;
        else if (p.second != 2 * n / 3)
          ok = false;
      }
      cout << (ok ? "Yes\n" : "No\n") << "\n";
    }
  }
  return 0;
}
