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