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