#include <iostream>
#include <map>

using namespace std;

int main() {
  int N;
  cin >> N;
  int a[N];
  int tmp[3];
  bool result = true;
  map<int, int> flg;

  //int flg_tmp[10];
  //memset(flg, 0, sizeof(flg));

  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (flg.count(a[i]) == 0) flg.emplace(a[i], 1);
    else flg[a[i]]++;
  }
  flg[a[0]]--;

  for (int n = 1; n < N-1; n++) {
    tmp[0] = a[0];

    map<int, int> flg_tmp(flg);
    tmp[1] = a[n];
    flg_tmp[a[n]]--;
    for (int i = 1; i < N-1; i++) {
      int num = tmp[0]^tmp[1];
      auto iter = flg_tmp.find(num);
      if (iter->first != flg_tmp.end() && iter->second > 0) {
        flg_tmp[num]--;
        tmp[0] = tmp[1];
        tmp[1] = num;
        if (i == N-2) {
          if ((tmp[0]^num) == a[0]) {
            cout << "Yes" << endl;
            return 0;
          }
        }
      } else {
        break;
      }
    }
  }

  cout << "No" << endl;

  return 0;
}
