#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int prev = n - 1, next = 1;
  if ((v[prev] ^ v[next]) != v[0]) {
    cout << "No\n";
    return 0;
  }
  for (int i = 1; i < n; i++) {
    prev = i - 1;
    next = (i + 1) % n;
    long long lhs = v[prev] ^ v[next];
    if (lhs != v[i]) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}
