#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n + 2);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  if (n % 2 == 0) {
    cout << "No" << endl;
    return 0;
  }
  a[n] = a[0];
  a[n + 1] = a[1];
  for (int i = 0; i < (n); ++i) {
    if (a[i] ^ a[i + 1] ^ a[i + 2] != 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
