#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a[200002];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  a[0] = a[n];
  a[n + 1] = a[1];
  for (int i = 1; i <= n; i++) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
