#include<stdio.h>
int main(void){
    int hat_sum;
    
    
    int j = 0;
    
    int k;


    scanf("%d",&hat_sum);
    int binaly[hat_sum];
	int hat_number[hat_sum];
    // convert intager to binary
    int i = 0;
    scanf("%d",&hat_number[0] * hat_sum, ...);
    do {
        int base = 1;
        binaly[i] = 0;
        k = hat_number;
        do {
        binaly[i] = binaly[i] + ( k % 2) * base;
        k = k / 2;
        base *= 10;
        } while ( k > 0);
        i++;
    } while ( i < hat_sum);
    
    i = 0;
    
    do {
        printf("%d\n", binaly[i] ^ binaly[i+2]);
        if (binaly[i+1] == (binaly[i] ^ binaly[i+2])){
            j++;
            i++;
        } else {
            break;
        }
    } while (i < hat_sum - 2);

    if (j == hat_sum - 2){
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}