#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <typename T, typename U>
ostream& operator<<(ostream& _s, pair<T, U> _t) {
  _s << "(" << _t.first << "," << _t.second << ")";
  return _s;
}
template <typename T, typename U>
istream& operator>>(istream& _s, pair<T, U>& _t) {
  _s >> _t.first >> _t.second;
  return _s;
}
template <typename T>
ostream& operator<<(ostream& _s, vector<T> _t) {
  for (int i = 0; i < (int)(_t.size()); i++) _s << (i ? " " : "") << _t[i];
  return _s;
}
template <typename T>
istream& operator>>(istream& _s, vector<T>& _t) {
  for (int i = 0; i < (int)(_t.size()); i++) _s >> _t[i];
  return _s;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<ll> a(n);
  cin >> a;
  bool ok = true;
  for (int i = 0; i < (int)(n); i++) {
    int i1 = i;
    int i2 = (i + 1) % n;
    int i3 = (i + 2) % n;
    if ((a[i1] ^ a[i2]) != a[i3]) {
      ok = false;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
}
