#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
void yes() {
  cout << "Yes" << endl;
  exit(0);
}
void no() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> cnt;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  long long uni = 0;
  for (auto&(x) : (cnt)) {
    uni++;
  }
  if (uni == 1) {
    if (cnt[0] > 0)
      yes();
    else
      no();
  }
  if (n % 3 != 0) no();
  if (uni > 3) no();
  if (uni == 3) {
    long long sum = 0;
    for (auto&(x) : (cnt)) {
      if (x.second != n / 3) no();
      sum ^= x.first;
    }
    if (sum == 0)
      yes();
    else
      no();
  }
  no();
}
