#include<stdio.h>
#include<stdlib.h>
long cmp(const void *a,const void *b){
  return *(long*)a-*(long*)b;
}

int main(){
  long n = 0;
  long a[100010] = {};
  long i = 0;
  long flag = 0;
  long tflag = 0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  qsort(a,n,sizeof(long),cmp);
  if(n % 3 == 0){
    for(i=0;i<n/3-1;i++){
      if(!(a[i] == a[i+1] && a[i+(n/3)] == a[i+1+(n/3)]
         && a[i+((2*n)/3)] == a[i+1+((2*n)/3)])){
        tflag = 1;
        break;
      }
    }
    if(!tflag){
      if(a[2*(n/3)] == (a[(n/3)]^a[0])){
        flag = 1;
        //printf("#");
      }else{
        flag = 0;
      }
    }
  }else{
    flag = 0;
  }
  //printf("%d %d %d %d",a[0],a[n/3],a[2*(n/3)]),a[(n/3)]^a[0];
  if(flag){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}
      
        
        
  
  