#include <bits/stdc++.h>
using namespace std;
int main() {
  long long num;
  bool chk = true;
  cin >> num;
  vector<long long> vec(num + 2);
  for (int i = 1; i < num + 1; i++) cin >> vec.at(i);
  vec.at(0) = vec.at(num);
  vec.at(num + 1) = vec.at(1);
  for (int i = 1; i <= num; i++) {
    if ((vec.at(i - 1) ^ vec.at(i + 1)) != vec.at(i)) {
      chk = false;
      break;
    }
  }
  if (chk == true)
    cout << "Yes";
  else
    cout << "No";
}
