#include <stdio.h>
#include <stdlib.h>

int compare(const void *a,const void *b){
  return *(int *)a - *(int *)b;
}

int main(){
  int n;
  int a[100000];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  qsort(a,n,sizeof(int),compare);
  int s = n/3;
  int t = 2*s;
  if(a[0] == 0 && a[s-1] == 0){
    if(a[n-1] == 0){
      printf("Yes");
      return 0;
    }else if(a[s] == a[n-1]){
      printf("Yes");
      return 0;
    }
  }else if(a[0] == a[s-1] && a[s] == s[t-1] && a[t] == a[n-1]){
    if((a[0]^a[s]^a[t]) == 0){
      printf("Yes");
      return 0;
    }
  }
  printf("No");
  return 0;
}