#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  map<int, int> ma;
  cin >> N;
  for (int i = 0; i < (N); i++) {
    cin >> A;
    ma[A]++;
  }
  if (ma.size() == 3) {
    pair<int, int> a[3];
    int i = 0;
    for (auto it = ma.begin(); it != ma.end(); it++) {
      a[i++] = *it;
    }
    if (((a[0].first ^ a[1].first) == a[2].first) &&
        (a[0].second == a[1].second) && (a[1].second && a[2].second)) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (ma.size() == 2) {
    pair<int, int> a[2];
    int i = 0;
    for (auto it = ma.begin(); it != ma.end(); it++) {
      a[i++] = *it;
    }
    if (a[1].first == 0) swap(a[0], a[1]);
    if (a[0].first == 0) {
      if (a[0].second * 2 == a[1].second) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
