#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, I, T, Nk;
  N = 0;
  I = 0;
  T = 0;
  Nk = 0;
  string S;
  S = "Yes";
  cin >> N;
  Nk = N + 1;
  vector<int> vec(Nk);
  for (int soezi1 = 0; soezi1 < N; soezi1++) {
    cin >> vec.at(soezi1);
  }
  vec.at(N) = vec.at(0);
  for (int soezi2 = 1; soezi2 < N; soezi2++) {
    I = vec.at(soezi2 - 1);
    T = vec.at(soezi2 + 1);
    I ^= T;
    if (I != vec.at(soezi2)) {
      S = "No";
    }
  }
  I = vec.at(1);
  T = vec.at(N - 1);
  I ^= T;
  if (I != vec.at(0)) {
    S = "No";
  }
  cout << S << endl;
}
