#include <bits/stdc++.h>
using namespace std;
const int base = 1e9 + 7;
const long long MAX_N = 1000001;
long long dd[MAX_N];
void Solves() {
  long long n;
  cin >> n;
  long long a[n + 5];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  a[n + 1] = a[1];
  a[0] = a[n];
  bool check = true;
  for (int i = 1; i <= n; i++) {
    if (a[i] != (a[i - 1] ^ a[i + 1])) {
      check = false;
      break;
    }
  }
  if (check)
    cout << "Yes";
  else
    cout << "No";
}
int main() { Solves(); }
