#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, a[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n + 1);
  bool flag = 1;
  for (int i = 2; i < n; i++) {
    flag &= (a[i] == (a[i - 1] ^ a[i + 1]));
  }
  flag &= (a[1] == (a[2] ^ a[n]));
  flag &= (a[n] == (a[1] ^ a[n - 1]));
  printf("%s\n", flag ? "YES" : "NO");
  return 0;
}
