int main(){
    int N;
    cin >> N;
    
    vector<int> A(N);
    map<int, int> list;
    
    for(int i = 0; i < N; ++i){
        cin >> A[i];
        list[A[i]]++;
    }
    
    int sp = 0;
    for(auto e : list){
        sp++;
    }
    
    if(sp == 1 && A[0] == 0){
        cout << "Yes" << endl;
        return 0;
    }
    
    if(sp != 3){
        cout << "No" << endl;
        return 0;
    }
    
    vector<int> cnt;
    vector<int> num;
    for(auto e : list){
        num.push_back(e.first);
        cnt.push_back(e.second);
    }
    
    
    if(N % 3 == 0 &&  (num[0] ^ num[1] == num[2])){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }