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