#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
int INF = 1 << 30;
long long INFL = 1LL << 60;
int main() {
  long long N;
  cin >> N;
  vector<long long> vec(N + 10);
  for (int i = 1; i < N + 1; i++) {
    cin >> vec.at(i);
  }
  vec.at(0) = vec.at(N);
  vec.at(N + 1) = vec.at(1);
  int f = 1;
  for (int i = 1; i < N; i++) {
    if ((vec.at(i - 1) ^ vec.at(i + 1)) == vec.at(i)) {
      f = 1;
    } else {
      f = 0;
      break;
    }
  }
  if (f == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
