#include <bits/stdc++.h>
using namespace std;
void fail() {
  cout << "No" << endl;
  exit(0);
}
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) fail();
  if (mp.size() == 2) {
    if (mp[0] != n / 3) fail();
  } else {
    vector<long long> vec;
    for (auto p : mp) {
      if (p.first != 0 && p.second == n / 3) vec.push_back(p.first);
    }
    if (vec[0] ^ vec[1] - vec[2] != 0) fail();
  }
  cout << "Yes" << endl;
  return 0;
}
