#include <bits/stdc++.h>
using namespace std;
long long arr[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  arr[0] = arr[n];
  arr[n + 1] = arr[1];
  bool flag = 1;
  for (int i = 1; i <= n; i++) {
    int x = (arr[i - 1] ^ arr[i + 1]);
    if (x != arr[i]) {
      flag = 0;
      break;
    }
  }
  if (flag)
    puts("Yes");
  else
    puts("No");
  return 0;
}
