#include <bits/stdc++.h>
using namespace std;
int main() {
  int flag = 0;
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      if ((long long)(a[n - 1] ^ a[1]) == a[0]) flag = 1;
    } else if (i == n - 1) {
      if ((long long)(a[n - 2] ^ a[0]) == a[n - 1]) flag = 1;
    } else {
      if ((long long)(a[i - 1] ^ a[i + 1]) == a[i]) flag = 1;
    }
    if (flag == 1) {
      cout << "Yes";
      return 0;
    }
  }
  if (flag == 1)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
