#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  int a;
  map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> a;
    ++cnt[a];
  }
  if (cnt.size() != 3) {
    cout << "No" << endl;
    return 0;
  } else {
    map<int, int>::const_iterator it = cnt.begin();
    int b = 0;
    for (int i = 1; i <= 3; i++) {
      if ((*it).second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
      b ^= (*it).first;
      it++;
    }
    if (b == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
