#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n), v;
  map<long long, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (cnt[a[i]] == 0) v.push_back(a[i]);
    cnt[a[i]]++;
  }
  if (n % 3 != 0) {
    if (cnt[0] == n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  bool b = false;
  sort(v.begin(), v.end());
  if (cnt[0] == n) {
    b = true;
  } else if (cnt[0] == n / 3 && cnt[v[1]] == 2 * n / 3) {
    b = true;
  } else if (cnt[v[0]] == n / 3 && cnt[v[1]] == n / 3 && cnt[v[2]] == n / 3 &&
             v[0] ^ v[1] ^ v[2] == 0) {
    b = true;
  }
  if (b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
