#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
const long long INF = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
ll min(ll a, ll b) {
  if (a < b)
    return a;
  else
    return b;
}
int main(void) {
  ll N;
  cin >> N;
  vector<ll> a(N, 0);
  for (int i = 0; i < N; i++) cin >> a[i];
  bool ans = true;
  for (int i = 1; i < N - 1; i++) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      ans = false;
      break;
    }
  }
  if ((a[N - 1] ^ a[1]) != a[0]) ans = false;
  if ((a[N - 2] ^ a[0]) != a[N - 1]) ans = false;
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
