#include <bits/stdc++.h>
using namespace std;
#define lint long long
//#define P pair<int, int>

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;
    
    vector<int> cnt;
    vector<int> num;
    for(auto e : list){
        sp++;
        num.push_back(e.first);
        cnt.push_back(e.second);
    }
    
    if(sp == 1 && A[0] == 0){
        cout << "Yes" << endl;
        return 0;
    }
    
    
    
    if(N % 3 == 0)
    {
        if(sp == 2){
            if((num[0] == 0 && cnt[0] == N / 3) || (num[1] == 0 && cnt[1] == N / 3)){
                cout << "Yes" << endl;
                return 0;
            } else {
                cout << "No" << endl;
                return 0;
            }
        } else {
            if(((num[0] ^ num[1]) == num[2])){
                cout << "Yes" << endl;
                return 0;
            } else {
                cout << "No" << endl;
                reutnr 0;
            }
        }
    }
    
}