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