#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> a(100010);
bool chelem(int n, int src) {
  for (int i = 0; i < (n); ++i) {
    if (a[i] == src) {
      int cp = a[i];
      a[i] = n;
      n = cp;
      return true;
    }
  }
  return false;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool flag = true;
  if ((a[1] ^ a[n - 1]) != a[0]) flag = chelem(a[0], (a[1] ^ a[n - 1]));
  if ((a[0] ^ a[n - 2]) != a[n - 1]) flag = chelem(a[n - 1], (a[0] ^ a[n - 2]));
  for (int i = 1; i < n - 1; ++i) {
    if ((a[i - 1] ^ a[i + 1]) != a[i])
      flag = chelem(a[i], (a[i - 1] ^ a[i + 1]));
  }
  cout << (flag ? "Yes" : "No") << '\n';
  return 0;
}
