#include <bits/stdc++.h>
using namespace std;
int solve() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  if ((a[n - 1] ^ a[1]) != a[0]) {
    cout << "No" << endl;
    return 0;
  }
  if ((a[n - 2] ^ a[0]) != a[n - 1]) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 1; i < n - 1; i++) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
