#include <bits/stdc++.h>
using namespace std;
int n, x;
map<int, int> ma;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    ma[x]++;
  }
  if (ma.size() == 1 && ma[0])
    printf("Yes\n");
  else if (ma.size() == 2) {
    if (ma[0] == n / 3 && n % 3 == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (ma.size() == 3) {
    bool f = true;
    int a[10], cnt = 0;
    for (auto A : ma) {
      a[cnt++] = A.first;
      if (A.second != n / 3) f = false;
    }
    if (a[0] ^ a[1] == a[2] && f && n % 3 == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else
    printf("No\n");
  return 0;
}
