#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) mp[a[i]]++;
  vector<pair<long long, long long>> p;
  for (pair<long long, long long> x : mp) p.push_back(x);
  if (p.size() == 3) {
    if (p[0].second == p[1].second == p[2].second) {
      if ((p[0].first ^ p[1].first) == p[2].first &&
          (p[1].first ^ p[2].first) == p[0].first &&
          (p[2].first ^ p[0].first) == p[1].first) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  if (p.size() == 2) {
    sort(p.begin(), p.end());
    if (p[0].first == 0) {
      if (p[0].second * 2 == p[1].second) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  if (p.size() == 1) {
    if (p[0].first == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
