#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> v(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> v[i];
  }
  do {
    bool flag = 0;
    for (int i = 0; i < N; i++) {
      int a, b;
      if (i == 0) {
        a = v[N - 1];
        b = v[i + 1];
      } else if (i == N - 1) {
        a = v[i - 1];
        b = v[0];
      } else {
        a = v[i - 1];
        b = v[i + 1];
      }
      if (v[i] != (a ^ b)) {
        flag = 1;
        break;
      }
      cout << "Yes" << endl;
      exit(0);
    }
    if (flag) {
      continue;
    }
  } while (next_permutation(v.begin(), v.end()));
  cout << "No" << endl;
}
