#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
int main(int argc, char **argv) {
  int n;
  while (~scanf("%d", &n)) {
    int flag = 0;
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    a[0] = a[n], a[n + 1] = a[1];
    for (int i = 1; i <= n; i++) {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) {
        flag = 1;
        break;
      }
    }
    if (!flag)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
