#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a[100000], x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 2; i++) {
    x = a[i] ^ a[i + 1];
    if (a[i + 2] == x) {
      if (i == n - 3) {
        cout << "Yes";
        break;
      }
      continue;
    } else {
      cout << "No";
      break;
    }
  }
}
