#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() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (N); i++) {
    cin >> a[i];
  }
  a.push_back(a[0]);
  a.push_back(a[1]);
  bool f = true;
  for (int i = 1; i < a.size() - 1; i++) {
    if (a[i] != (a[i - 1] ^ a[i + 1])) {
      f = false;
      break;
    }
  }
  cout << (f ? "Yes" : "No") << endl;
}
