#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e+9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  vector<ll> a(n + 2);
  for (int i = 0; i < n; i++) cin >> a.at(i);
  a.at(n) = a.at(0);
  a.at(n + 1) = a.at(1);
  bool flag = true;
  for (int i = 1; i < n + 1; i++) {
    ll t = a.at(i - 1) ^ a.at(i + 1);
    if (a.at(i) != t) {
      flag = false;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
