#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < N; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  map<int, int> c;
  for (int i = 0; i < N; ++i) {
    c[a[i]] += 1;
  }
  if (c.size() == 1 && c[0] > 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (a.size() % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (c.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> tmp;
  for (auto itr = c.begin(); itr != c.end(); ++itr) {
    tmp.push_back(itr->first);
  }
  if (c.size() == 2) {
    if (c[0] > 0 && c[0] * 2 == c[tmp[1]]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    if ((tmp[0] ^ tmp[1]) == tmp[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
