#include <bits/stdc++.h>
using namespace std;
long long main(long long argc, char const *argv[]) {
  long long n;
  cin >> n;
  std::vector<long long> data(n);
  for (long long i = 0; i < n; i++) cin >> data[i];
  bool flag = true;
  for (long long i = 0; i < n; ++i) {
    long long a;
    if (i == 0)
      a = data[n - 1];
    else
      a = data[i - 1];
    long long b;
    if (i == n - 1)
      b = data[0];
    else
      b = data[i + 1];
    if ((a ^ b) != data[i]) {
      flag = false;
    }
  }
  if (flag)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
  return 0;
}
