#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> v(N);
  map<int, int> mp;
  for (int i = 0; i < N; ++i) {
    cin >> v[i];
    mp[v[i]]++;
  }
  bool ok = false;
  if (N % 3 == 0) {
    if (mp.size() == 1) {
      if (v[0] == 0) ok = true;
    } else if (mp.size() == 2) {
      bool aok = true;
      vector<int> nums(2);
      for (auto m : mp) {
        if (m.first == 0) {
          if (m.second == N / 3) continue;
        } else {
          if (m.second == N / 3 * 2) continue;
        }
        aok = false;
      }
      ok |= aok;
    } else {
      bool aok = true;
      vector<int> nums(3);
      for (auto m : mp) {
        nums.push_back(m.first);
        if (m.second != N / 3) aok = false;
      }
      if (nums[0] ^ nums[1] != nums[2]) aok = false;
      ok |= aok;
    }
  }
  if (mp[0] == N) ok = true;
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
