#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
const long long LL_MAX = 9223372036854775807;
using namespace std;
long long a[100005 * 10];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  a[0] = a[n], a[n + 1] = a[1];
  for (int i = 1; i <= n; i++) {
    long long t = (long long)(a[i - 1] ^ a[i + 1]);
    if (t != a[i]) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
