#include <bits/stdc++.h>
using namespace std;
long long n, v[1000005];
bool ok, zero;
map<int, int> us;
vector<int> num;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  zero = true;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (us[v[i]] == 0) {
      num.push_back(v[i]);
    }
    us[v[i]]++;
    if (v[i] != 0) {
      zero = false;
    }
  }
  if (n % 3 != 0) {
    if (zero == false)
      ok = false;
    else
      ok = true;
  } else {
    if (num.size() == 3) {
      if (((num[0] ^ num[1] ^ num[2]) != 0) || us[num[0]] != n / 3 ||
          us[num[1]] != n / 3 || us[num[2]] != n / 3)
        ok = false;
      else
        ok = true;
    } else {
      if (zero == true)
        ok = true;
      else
        ok = false;
    }
  }
  if (ok)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
