#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int f = 0;
  if ((a[n - 1] ^ a[1]) != a[0]) f = 1;
  if (f == 1)
    cout << "No";
  else {
    for (int i = 1; i < n; i++) {
      if ((a[(i - 1) % n] ^ a[(i + 1) % n]) != a[i]) {
        f = 1;
        break;
      }
    }
    if (f == 1)
      cout << "No";
    else
      cout << "Yes";
  }
  return 0;
}
