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