#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
 
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a) (a).begin(),(a).end()
 
int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n){
        cin >> a[i];
    }
    sort(ALL(a));
    vector<ll> c;
    vector<ll> sum(1);
    sum[0] = 0;
    c.push_back(a[0]);
    ll no = 1;
    while(a[no] == a[0]){
        no++;
        sum[0]++;
    }
    
    for(int i = no; i < n; i++){
        ll cnt = 0;
        while(a[i] == a[i-1] && i < no){
            i++;
            cnt++;
        }
        sum.push_back(cnt);
        c.push_back(a[i]);
        if(c.size()>3){
            cout << "No";
            return 0;
        }
    }
    if(sum.size() == 1){
        if(c[0] == 0)cout << "Yes";
        else cout << "No";
        return 0;
    }
    if(n %3 != 0){
        cout << "No";
        return 0;
    }
    else if(sum.size() == 2){
        if(sum[0]*2 == sum[1] && c[0] == 0)cout << "Yes";
        else if(sum[1]*2 == sum[0] && c[1] == 0)cout << "Yes";
        else cout << "No";
    }
    else {
        if(sum[0] == sum[1] && sum[1] == sum[2]){
           if(c[0] != 0 && c[1] != 0 && c[2] != 0 && (c[0]^c[1])^c[2])==0) cout << "Yes";
           else cout << "No";
        }
        else cout << "No";
    }
    
    return 0;
}