#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a.at(i);
  int l, r;
  for (int i = 0; i < N; i++) {
    l = (i == 0) ? N - 1 : i - 1;
    r = (i == N - 1) ? r = 0 : r = i + 1;
    if ((a[l] ^ a[r]) == a[i]) continue;
    puts("No");
    return 0;
  }
  puts("Yes");
}
