#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  bool check = true;
  for (int i = 0; i < (n); ++i) {
    if (i == 0) {
      if ((v[n - 1] ^ v[1]) != v[i]) {
        check = false;
        break;
      }
    } else if (i == n - 1) {
      if ((v[n - 2] ^ v[0]) != v[i]) {
        check = false;
        break;
      }
    } else {
      if ((v[i - 1] ^ v[i + 1]) != v[i]) {
        check = false;
        break;
      }
    }
  }
  if (check) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
