#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  a.resize(unique(a.begin(), a.end()) - a.begin());
  if (a.size() == 1 && a[0] == 0) {
    cout << "Yes";
    return 0;
  }
  if (a.size() == 2 && cnt.count(0) && cnt[0] == n / 3) {
    cout << "Yes";
    return 0;
  }
  if (n % 3 == 0 && a.size() == 3 && a[0] ^ a[1] ^ a[2] == 0 &&
      cnt[a[0]] == n / 3 && cnt[a[1]] == n / 3) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
