#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll, ll>;
int main() {
  ll N;
  cin >> N;
  vec A(N + 2);
  for (ll(i) = (1), (i_len) = (N + 1); (i) < (i_len); ++(i)) cin >> A[i];
  A[0] = A[N];
  A[N + 1] = A[1];
  bool f = true;
  for (ll(i) = (1), (i_len) = (N + 1); (i) < (i_len); ++(i)) {
    if ((A[i - 1] ^ A[i] ^ A[i + 1]) != 0) {
      f = false;
      break;
    }
  }
  if (f)
    cout << ("Yes") << endl;
  else
    cout << ("No") << endl;
  return 0;
}
