#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long i;
  set<long long> s;
  map<long long, long long> mp;
  for (i = 0; i < n; i++) {
    long long a;
    cin >> a;
    s.insert(a);
    mp[a]++;
  }
  if (s.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long> v;
  long long is_zero = 0;
  for (auto x : s) {
    v.push_back(x);
    if (x == 0) {
      is_zero = 1;
    }
  }
  if (is_zero) {
    if (v.size() != 2) {
      cout << "No" << endl;
      return 0;
    } else {
      long long temp;
      if (v[0] == 0) {
        temp = v[1];
      } else {
        temp = v[0];
      }
      if (mp[temp] == (2 * mp[0])) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  } else {
    if (v.size() != 3) {
      cout << "No" << endl;
      return 0;
    }
    if (((v[0] ^ v[1]) == v[2]) || ((v[0] ^ v[2]) == v[1])) {
      if (mp[v[0]] == mp[v[1]]) {
        if (mp[v[0]] == mp[v[2]]) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    }
    cout << "No" << endl;
  }
  return 0;
}
