#include <bits/stdc++.h>
using namespace std;
int main() {
  static long long N, A[100000];
  vector<long long> V;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i], V.push_back(A[i]);
  sort(V.begin(), V.end());
  V.erase(unique(V.begin(), V.end()), V.end());
  if (V.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (V.size() == 1) {
    cout << "Yes" << endl;
    return 0;
  } else if (V.size() == 2) {
    if (V[0] != 0) {
      cout << "No";
      return 0;
    } else {
      map<int, int> mp;
      for (int i = 0; i < N; i++) {
        mp[A[i]]++;
      }
      if (mp[V[0]] == mp[V[1]]) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  if ((V[0] ^ V[1]) != V[2]) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < N; i++) {
    mp[A[i]]++;
  }
  if (mp[V[0]] == mp[V[1]] && mp[V[1]] == mp[V[2]])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
