#include <bits/stdc++.h>
using namespace std;
int n;
int a[100100], p[10], tot = 0, cnt[100100];
bool vis[100100];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  if (n % 3 == 0) {
    bool fg = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i]) fg = 1;
    }
    if (!fg) {
      printf("Yes\n");
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      if (!vis[a[i]]) {
        vis[a[i]] = 1, p[++tot] = a[i];
        if (tot > 3) {
          printf("No\n");
        }
      }
      cnt[a[i]]++;
    }
    if (tot == 1) {
      printf("No\n");
    }
    if (tot == 2) {
      if (p[1] == 0 && cnt[0] == n / 3) {
        printf("Yes\n");
      } else {
        printf("No\n");
      }
    }
    if (tot == 3) {
      if (cnt[1] == n / 3 && cnt[2] == n / 3) {
        if ((p[1] ^ p[2]) == p[3]) {
          printf("Yes\n");
          return 0;
        }
      }
      printf("No\n");
    }
    return 0;
  }
  if (n % 3 == 1) {
    for (int i = 1; i <= n; i++) {
      if (a[i]) {
        printf("No\n");
        return 0;
      }
    }
    printf("Yes\n");
    return 0;
  }
  if (n % 3 == 2) {
    bool fg = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i]) fg = 1;
    }
    if (!fg) {
      printf("Yes\n");
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      if (!vis[a[i]]) {
        vis[a[i]] = 1, p[++tot] = a[i];
        if (tot > 2) {
          printf("No\n");
        }
      }
      cnt[a[i]]++;
    }
    if (tot == 1) {
      printf("No\n");
    }
    if (tot == 2) {
      if (p[1] == (n + 1) / 3)
        printf("Yes\n");
      else
        printf("No\n");
    }
    return 0;
  }
  return 0;
}
