#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
int main() {
  int n;
  cin >> n;
  vector<int> vec(n + 2);
  for (int i = 0; i < (n); ++i) cin >> vec[i];
  vec[n] = vec[0];
  vec[n + 1] = vec[1];
  bool flag = 1;
  for (int i = 1; i < n + 1; i++) {
    if ((vec[i - 1] ^ vec[i + 1]) != vec[i]) {
      flag = 0;
    }
  }
  if (flag)
    cout << ("Yes") << "\n";
  else
    cout << ("No") << "\n";
  return 0;
}
