#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
bool chmax(T& a, T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T& a, T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
constexpr int INF = 2e9;
int main() {
  int N;
  cin >> N;
  vector<ll> a(N);
  for (ll i = 0, i_len = (N); i < i_len; i++) cin >> a[i];
  bool isYes = true;
  for (ll i = 0; i < N; i++) {
    if (i == 0) {
      if ((a[N - 1] ^ a[i + 1]) != a[i]) {
        isYes = false;
      }
    } else if (i + 1 == N) {
      if ((a[i - 1] ^ a[0]) != a[i]) {
        isYes = false;
      }
    } else if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      isYes = false;
    }
  }
  cout << (isYes ? "Yes" : "No") << endl;
  return 0;
}
