#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long c, long long d) { return c / gcd(c, d) * d; }
const long long MOD = 1000000007;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool exist = false;
  for (int i = 0; i < (n); ++i) {
    long long l = i - 1;
    long long r = i + 1;
    if (l < 0) l = n - 1;
    if (r > n - 1) r = 0;
    if ((a[l] ^ a[r]) != a[i]) {
      exist = true;
      break;
    }
  }
  cout << ((exist) ? "Yes" : "No") << endl;
  return 0;
}
