#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e+18 + 1;
const long long MOD = 1000000007LL;
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vector<long long> dx = {-1, -1, -1, 0, 0, 1, 1, 1};
vector<long long> dy = {1, -1, 0, 1, -1, 1, 0, -1};
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i];
  set<long long> S;
  vector<long long> vec;
  map<long long, long long> M;
  for (long long i = 0; i < (long long)(n); i++) {
    M[a[i]]++;
    if (!S.count(a[i])) {
      vec.push_back(a[i]);
      S.insert(a[i]);
    }
  }
  if (vec.size() == 1 && vec[0] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if ((vec[0] ^ vec[1]) == vec[2] && M[vec[0]] == M[vec[1]] &&
      M[vec[1]] == M[vec[2]]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
