#include <bits/stdc++.h>
using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;
const llong inf = 1100100100100100ll;
const llong mod = 1e9 + 7;
int main() {
  llong N;
  vector<llong> a;
  map<llong, llong> m;
  cin >> N;
  a.resize(N);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (m.size() == 1 && m[0] > 0) {
    cout << "Yes" << endl;
  } else if (N % 3 != 0) {
    cout << "No" << endl;
  } else {
    if (m.size() != 3) {
      cout << "No" << endl;
    } else {
      return 1;
      map<llong, llong> mm;
      vector<llong> v;
      for (auto it = m.begin(); it != m.end(); ++it) {
        v.push_back(it->first);
        mm[it->second]++;
      }
      if (mm.size() != 1) {
        cout << "No" << endl;
      } else {
        if ((v[0] ^ v[2]) == v[1] && (v[1] ^ v[0]) == v[2] &&
            (v[2] ^ v[1]) == v[0]) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      }
    }
  }
  return 0;
}
