#include <bits/stdc++.h>
int main() {
  using namespace std;
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (*max_element(a.begin(), a.end()) == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  map<int, int> mp1;
  for (int i = 0; i < n; i++) {
    mp1[a[i]]++;
  }
  vector<int> v;
  for (auto x : mp1) {
    v.push_back(x.first);
  }
  if (v.size() == 3 && count(a.begin(), a.end(), v[0]) == n / 3 &&
      count(a.begin(), a.end(), v[1]) == n / 3 && v[0] ^ v[1] == v[2]) {
    cout << "Yes" << endl;
    return 0;
  }
  if (v.size() == 2 && count(a.begin(), a.end(), 0) == n / 3) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
