#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005], cnt[10], tot, num[10];
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]++, num[++tot] = a[i];
      else
        cnt[tot]++;
      if (tot > 3) {
        puts("No");
        f = 0;
        break;
      }
    }
    if (f == 0) continue;
    if (n % 3 == 0) {
      if (tot == 3 && num[1] ^ num[2] ^ num[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;
}
