#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    flag = (a[i == 0 ? n - 1 : i - 1] ^ a[i == n - 1 ? 0 : i + 1]) == a[i];
    if (!flag) break;
  }
  if (flag)
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
}
