#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  long long num;
  map<long long, long long> mp;
  for (long long i = 0; i < N; i++) {
    cin >> num;
    mp[num]++;
  }
  long long size = mp.size();
  if (size == 2) {
    if (mp[0] == (N / 3) * 2) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (size == 3) {
    auto iter = mp.begin();
    long long key1 = iter->first;
    long long val1 = iter->second;
    iter++;
    long long key2 = iter->first;
    long long val2 = iter->second;
    iter++;
    long long key3 = iter->first;
    long long val3 = iter->second;
    if (val1 == val2 && val2 == val3) {
      if (key1 ^ key2 == key3) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}
