#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> m;
  for (long long i = 0; i < (n); i++) {
    long long a;
    cin >> a;
    m[a]++;
  }
  auto itr = m.find(0);
  if (itr != m.end()) {
    if (m[0] == n) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else {
    if (m.size() != 3) {
      cout << "No" << endl;
    } else {
      long long val[2][3];
      long long i = 0;
      for (auto x : m) {
        val[0][i] = x.first;
        val[1][i] = x.second;
        i++;
      }
      if (val[1][0] == val[1][1] && val[1][0] == val[1][2] &&
          (val[0][0] ^ val[0][2]) == val[0][1] &&
          (val[0][1] ^ val[0][0]) == val[0][2] &&
          (val[0][2] ^ val[0][1]) == val[0][0]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
