#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  int a[N + 2];
  for (int i = 0; i < N; i++) {
    cin >> a[i + 1];
  }
  a[0] = a[N];
  a[N + 1] = a[1];
  int sum1 = 0;
  int sum2 = 0;
  for (int i = 0; i < N; i++) {
    sum1 += a[i] ^ a[i + 2];
    sum2 += a[i + 1];
  }
  if (sum1 == sum2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
