#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a(4, make_pair(0, 0));
  int poss = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    int j = 0;
    for (j = 0; j < cnt; j++) {
      if (x == a[j].first) {
        a[j].second++;
        break;
      }
    }
    if (j != cnt) continue;
    a[cnt++] = make_pair(x, 1);
    if (cnt > 3) {
      break;
    }
  }
  if (cnt == 3 && ((a[0].first ^ a[1].first) == a[2].first)) {
    int maxdiff = abs(a[0].second - a[1].second);
    maxdiff = max(maxdiff, a[1].second - a[2].second);
    maxdiff = max(maxdiff, a[0].second - a[2].second);
    if (maxdiff <= 1) poss = 1;
  }
  if (n % 3 == 2) {
    poss = 0;
  }
  if (cnt == 1) poss = 1;
  if (poss)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
