#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n; cin >> n; // 3<=n<=10^5
  vector<int> a; // 1<=ai<=10^9
  rep(i,n) cin >> a[i];
  a.push_front(a[n-1]);
  a.push_back(a[0]);
  rep (i, n) {
    if (a[i] ^ a[i+2] == a[i+1]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
