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