#include<stdio.h>

int main(void){
    int i,n,flag,t1,t2;
    flag = 0;
    scanf("%d",&n);
    long int a[n+1]; 
    for(i=0; i<n; i++){
        scanf("%d",&a[i]);
    }

    
    for( i = 1; i < n-1; i++){
        if(a[i-1] ^ a[i+1]  != a[i] ){
            flag = 1;
            break;
        }
    }

    t1 = a[1] ^ a[n-1];
    if( t1 !=a[0]){
        flag = 1;
    }
    t2 = a[n-2] ^ a[0]
    if( t2 !=a[n-1]){
        flag = 1;
    }

    

    if( flag ==  0 ){
        printf("Yes\n");
    }else{
        printf("%d\n",a[0]^a[1]);
    }

    return 0;

}