#include <stdio.h>
#include <map>

int main(){
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i = 0; i < n; i++){
        scanf("%d", &a[i]);
    }
    
    bool can = true;
    
    //is all 0?
    bool all0 = true;
    for(int i = 0; i < n; i++){
        if(a[i] != 0){
            all0 = false;
        }
    }

    if(all0){
        printf("Yes\n");
        return 0;
    }

    std::map<int, int> count;
    for(int i = 0; i < n; i++){
        count[a[i]]++;
    }

    if(count.size() > 3){
        printf("No\n");
        return 0;
    }else if(count.size() == 2){
        int set[2], num[2];
        auto itr = count.begin();
        set[0] = itr->first, num[0] = itr->second;
        itr++;
        set[1] = itr->first, num[1] = itr->second;
        if((num[0] * 2 == num[1] && set[0] == 0) || (num[1] * 2 == num[0] && set[1] == 0)){
            printf("Yes\n");
            return 0;
        }else{
            printf("No\n");
            return 0;
        }
    }else if(count.size() == 3){
        int set[3], num[3];
        auto itr = count.begin();
        set[0] = itr->first;
        num[0] = itr->second;
        itr++;
        set[1] = itr->first;
        num[1] = itr->second;
        itr++;
        set[2] = itr->first;
        num[2] = itr->second;
        if(num[0] == num[1] && num[1] == num[2]){
            if(set[0] == set[1] ^ set[2] && set[1] == set[2] ^ set[0] && set[2] == set[0] ^ set[1]){
                printf("Yes\n");
                return 0;
            }else{
                printf("No\n");
                return 0;
            }
        }else{
            printf("No\n");
            return 0;
        }
    }else if(count.size() == 1){
        if(*(count.begin()) != 0){
        printf("No\n");
        }else{
            printf("Yes\n");
        }
        return 0;
    }else{
        printf("No\n");
        return 0;
    }
}