#include <bits/stdc++.h>
using namespace std;
template <class T>
istream& operator>>(istream& s, vector<T>& v) {
  for (T& x : v) {
    s >> x;
  }
  return s;
}
template <class T>
void cout_h(const vector<T>& c, int n = INT_MAX) {
  for (int i = 0; i < (min(n, (int)c.size())); i++)
    cout << c[i] << (i == c.size() - 1 ? "\n" : " ");
}
template <class T>
inline bool chmin(T& a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool chmax(T& a, T b) {
  return a < b ? a = b, true : false;
}
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (N); i++) cin >> a;
  bool f = true;
  if (a[0] != (a[N - 1] ^ a[N - 2]) || a[1] != (a[N - 1] ^ a[0])) {
    f = false;
  } else {
    for (int i = 3; i < N; i++) {
      if (a[i] != (a[i - 1] ^ a[i - 2])) {
        f = false;
        break;
      }
    }
  }
  cout << (f ? "Yes" : "No") << endl;
}
