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