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