#include <bits/stdc++.h>
using namespace std;
long long const MAX = 1e5;
int main() {
  long long n;
  cin >> n;
  vector<long long> v(n + 5);
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
  }
  sort(v.begin() + 1, v.begin() + 1 + n);
  bool flag = 1;
  for (long long i = 2; i <= n; i++) {
    if (v[1] != v[i]) {
      flag = 0;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 == 0) {
    bool flag = 1;
    long long m = n / 3;
    if (v[m] == v[m * 2]) {
      flag = 0;
    }
    if (v[m * 2] == v[m * 3]) {
      flag = 0;
    }
    for (long long i = 1; i <= n; i++) {
      if (v[((i - 1) / m) * m + 1] != v[i]) {
        flag = 0;
      }
    }
    if ((v[m] ^ v[m * 2] ^ v[m * 3]) != 0) {
      flag = 0;
    }
    if (flag) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
