#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
map<int, int> app;
int differ;
int flag = 1;
int flag2 = 0;
int main() {
  int n;
  int ai;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> ai;
    if (ai == 0) flag2 = 1;
    if (ai) flag = 0;
    if (app[ai] == 0) {
      app[ai] = 1;
      differ++;
    } else {
      app[ai]++;
    }
  }
  if (flag) {
    cout << "Yes";
    return 0;
  }
  map<int, int>::iterator ite;
  ite = app.begin();
  if (differ == 3 && !flag2) {
    pair<int, int> a, b, c;
    a = make_pair(ite->first, ite->second);
    ite++;
    b = make_pair(ite->first, ite->second);
    ite++;
    c = make_pair(ite->first, ite->second);
    int resflag = 0;
    if ((a.first ^ b.first) == c.first) {
      swap(b, c);
      resflag = 1;
    }
    if ((a.first ^ c.first) == b.first) {
      resflag = 1;
    }
    if ((b.first ^ c.first) == a.first) {
      swap(b, a);
      resflag = 1;
    }
    if (resflag)
      if (a.second == c.second && b.second == a.second) {
        cout << "Yes";
        return 0;
      }
  }
  if (differ == 2 && flag2) {
    pair<int, int> a, zer;
    zer = make_pair(ite->first, ite->second);
    ite++;
    a = make_pair(ite->first, ite->second);
    if (a.second == zer.second - 1) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
  return 0;
}
