#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int N;
  cin >> N;
  vector<long long> a(N);
  map<int, int> mp;
  bool flg = true;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    ++mp[a[i]];
    if (a[i] != 0) flg = false;
  }
  if (flg) {
    cout << "Yes" << endl;
  } else if (N % 3 != 0) {
    cout << "No" << endl;
  } else if (mp.size() == 3) {
    vector<int> x(3);
    int id = 0;
    for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
      x[id++] = itr->first;
    }
    if ((x[0] ^ x[2]) == x[1]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 2) {
    if (mp[0] == N / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
