#include <bits/stdc++.h>
using namespace std;
int n;
int a[80005], cnt[80005], tot;
int main() {
  int T = 1;
  while (T--) {
    bool f = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (a[i] != 0) f = 1;
    }
    if (f == 0) {
      puts("Yes");
      continue;
    }
    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; i++)
      if (a[i] != a[i - 1])
        cnt[++tot]++;
      else
        cnt[tot]++;
    if (tot == 3 &&
        a[cnt[1]] ^ a[cnt[1] + cnt[2]] ^ a[cnt[1] + cnt[2] + cnt[3]] == 0 &&
        cnt[1] >= n / 3 && cnt[2] >= n / 3 && cnt[3] >= n / 3) {
      puts("Yes");
      continue;
    }
    if (tot == 2 && a[1] == 0 && cnt[1] >= n / 3 * 2 && cnt[2] >= n / 3) {
      puts("Yes");
      continue;
    }
    puts("No");
  }
  return 0;
}
