#include <bits/stdc++.h>
using namespace std;
template <class T>
void cout_vec(const vector<T> &vec) {
  for (auto itr : vec) cout << itr << ' ';
  cout << '\n';
}
const long long mod = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n);
  set<long long> cnt;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    cnt.insert(a[i]);
  }
  if (n % 3 == 0 && long long(cnt.size()) == 3) {
    vector<long long> now;
    bool flag = false;
    for (auto itr : cnt) {
      now.push_back(itr);
    }
    do {
      long long ch = 0;
      if ((now[0] ^ now[1]) == now[2]) ch++;
      if ((now[2] ^ now[1]) == now[0]) ch++;
      if ((now[0] ^ now[2]) == now[1]) ch++;
      if (ch == 3) flag = true;
    } while (next_permutation(begin(now), end(now)));
    if (flag) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (n % 3 == 0 && long long(cnt.size()) < 3) {
    bool flag = false;
    for (auto itr : cnt) {
      if (itr == 0) flag = true;
    }
    if (flag) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (long long(cnt.size()) == 1) {
    for (auto itr : cnt) {
      if (itr == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}
