#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename A, typename B>
inline bool chmin(A &a, const B &b) {
  if (a > b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
template <typename A, typename B>
inline bool chmax(A &a, const B &b) {
  if (a < b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
int main() {
  int N;
  cin >> N;
  vector<unsigned long> circ(N + 2);
  for (int i = 0; i < (int)(N); i++) {
    cin >> circ[i + 1];
  }
  circ[0] = circ[N];
  circ[N + 1] = circ[1];
  string ans = "Yes";
  for (int i = 1; i <= N; i++) {
    unsigned long tmp = circ[i - 1] ^ circ[i + 1];
    if (tmp != circ[i]) {
      ans = "No";
    }
  }
  cout << ans << endl;
}
