#include <bits/stdc++.h>
using i64 = int64_t;
using namespace std;
int main() {
  int N;
  cin >> N;
  map<i64, i64> m;
  for (int i = 0; i < N; i++) {
    i64 a;
    cin >> a;
    if (!m.count(a)) {
      m[a] = 0;
    }
    m[a]++;
  }
  vector<i64> v;
  i64 n = -1;
  for (auto x : m) {
    if (n < 0) {
      n = x.second;
    } else {
      if (n != x.second) {
        cout << "No" << endl;
        return 0;
      }
    }
    v.push_back(x.first);
  }
  if (v.size() > 3) {
    cout << "No" << endl;
  } else if (v.size() == 3) {
    if ((v[0] ^ v[1]) == v[2] && m[v[0]] == m[v[1]] && m[v[1]] == m[v[2]] &&
        m[v[2]] == m[v[0]]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (v.size() == 2) {
    if ((v[0] == 0 && m[v[1]] == 2 * m[v[0]]) ||
        (v[0] == 0 && m[v[1]] == 2 * m[v[0]])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (v.size() == 1) {
    if (v[0] == v[1] && v[1] == v[2] && v[2] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
