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