#include <bits/stdc++.h>
const int N = 1e5 + 10;
long long a[N];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 2; i < n; i++)
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      puts("No");
      return 0;
    }
  if ((a[2] ^ a[n]) == a[1] && (a[1] ^ a[n - 1]) == a[n])
    puts("Yes");
  else
    puts("No");
  return 0;
}
