#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
const ll MOD = 1e9 + 7;
const ll LINF = 1LL << 60;
const int INF = 1e9 + 7;
int main() {
  ll n;
  cin >> n;
  ll a[n + 2];
  for (ll i = 0; i < n; ++i) cin >> a[i + 1];
  a[0] = a[n];
  a[n + 1] = a[1];
  for (ll i = 1; i <= n; ++i) {
    ll xr = (a[i - 1] ^ a[i + 1]);
    if (xr != a[i]) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
}
