v#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
using namespace std;
int MOD = 1000000007;

signed main(){
    int n;
    cin >> n;
    vector<int> a(n);
    map<int,int> m;
    rep(i,n){
        int a;
        cin >> a;
        m[a]++;
    }
    auto itr = m.find(0);
    if(itr != m.end()){
        if(m[0] == n){
            cout << "Yes" << endl;
        }else cout << "No" << endl;
    }else{
        if(m.size() != 3){
            cout << "No" << endl;
        }else{
            int val[2][3];
            int i = 0;
            for(auto x:m){
                val[0][i] = x.fi;
                val[1][i] = x.se;
                i++;
            }
            if(val[1][0] == val[1][1] && val[1][0] == val[1][2]
                && (val[0][0]^val[0][2]) == val[0][1]
                && (val[0][1]^val[0][0]) == val[0][2]
                && (val[0][2]^val[0][1]) == val[0][0]){
                    cout << "Yes" << endl;
            }else{
                cout << "No" << endl;
            }
        }
    }

    
    
    return 0;
}

// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl https://cf17-final-open.contest.atcoder.jp/tasks/cf17_final_a
// rm -r -f test;oj dl http://agc035.contest.atcoder.jp/tasks/agc035_a