#include<stdio.h>
#include <stdlib.h>
void hann( short int a,short int b,short int c);
int main(){
  
  short int n,
  int i,j;
  bool e=false;
  
  scanf("%d",&n);
   short int ar[n];
  for(j=0;i<n;j++)scanf("%d ",&ar[n]);
  
  hann(0,ar[0],ar[1]);
  
  for(i=1;i<n-1;i++){
  hann(ar[i-1],ar[i],ar[i+1]);
    
  }
  
  hann(ar[n-2],ar[n-1],0);
  
  if(e==true)printf("Yes");
  
    
   
    
    
    
    return 0;
  }
    
    void hann( short int a,short int b,short int c){
      if(a^c==b){e=true}
      else{printf("No");
           exit(0);
          }
      
      
      
    