#include<fstream>
#include<string>
#include<iostream>
#include<sstream>
#include<iterator>
#include<cmath>

using namespace std;

int makeans(int i,int N,long int a[N],long int b[N]){
  for(j=1;j<N;j++){
    if(b[i-2]^a[j] == b[i-1]){
     return a[j];
     break;}}
  else{return -1}
}   
  
int main(){
 int N;
 cin >> N;
 long int a[N];
 long int b[N];
 int i;
 int j;
 for(i=0;i<N;++i){
    cin >> a[i];
   }
 b[0] = a[0];
 int check;
 int k;
 for(i=1;i<N;i++){
  for(j=1;j<N;j++){
    check = 0;
    if(a[0]^a[i] == a[j] && a[i] != a[j]){
      b[1] = a[j];
      b[2] = a[i];
    for(k=3;k<N;k++){
      b[k] = makeans(k,N,a[N],b[N]);
      if(b[k]==-1){check = -1; break;}
    }
    if(check==0){
      if(b[N-2]^b[0]==b[N-1])cout << "Yes"; break;}
    }}}
  if(check==-1)cout << "No";
  return 0;
}
      

  cout << count;
 return 0;
}