#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1050000000;
const long long LINF = 1LL << 60;
const ll MOD = 1e9 + 7;
const int MINF = -1050000000;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  deque<ll> a;
  cin >> n;
  a.resize(n);
  for (int i = (int)0; i < (int)n; ++i) cin >> a[i];
  ll begin = a[0], end = a[n - 1];
  a.push_front(end);
  a.push_back(begin);
  bool ok = true;
  for (int i = 1; i < n + 1; ++i) {
    ll self = a[i];
    ll l = a[i - 1];
    ll r = a[i + 1];
    ll target = l ^ r;
    if (self != target) ok = false;
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
