#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> A(n);
  for (auto &a : A) cin >> a;
  for (long long i = 0; i < n; i++) {
    if ((long long)(A[(i + 1) % n]) != (long long)(A[i] ^ A[(i + 2) % n])) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
