#include <algorithm>
#include <bitset>
//#include <boost/multiprecision/cpp_int.hpp>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <sstream>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
//namespace mp = boost::multiprecision;
using namespace std;
using ull = unsigned long long;
using ld = long double;
// using ll = boost::multiprecision::cpp_int;
using ll = long long;
#define FORi(N) for(ll i = 0; i < N; ++i)
#define FORj(N) for(ll j = 0; j < N; ++j)
#define FORk(N) for(ll k = 0; k < N; ++k)

#define ALL(v) v.begin(),v.end()
// using int = ll;
ll gcd(ll m, ll n) {
    if(n == 0)
        return abs(m);
    return (gcd(n, m % n));
}
void putYN(bool b) {
    if(b) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}
void swap(ll &a, ll &b) {
    ll tmp = a;
    a = b;
    b = tmp;
}
ll combi(ll n, ll k) {
    ll r = 1, rr = 1;
    for(ll i = 0; i < k; ++i) {
        r *= (n - i);
        rr *= (i + 1);
        // r %= 1000000007;
        // rr %= 1000000007;
    }
    r /= rr;
    // r %= 1000000007;
    return r;
}

int main() {
    ll N;
    cin >> N;
    map<ll,ll> a;
    bool flag = true;
    FORi(N) {
        ll tmp;
        cin >> tmp;
        if(a.find(tmp)==a.end()){
            a[tmp] = 1;
        }else{
            a[tmp]++;
        }
        if(a.size()>3){
            flag = false;
            break;
        }
    }
    if(flag){
        if(a.size()==3){
            auto i0 = a.begin();
            auto i1 = i0;
            auto i2 = i0;
            i1++;
            i2++;
            i2++;
            //cout << i0->first;
            //cout << i1->first;
            //cout << i2->first;
            if((ll)(i1->first^i2->first)!=i0->first){
                //cout << (ll)(i1->first^i2->first);
                flag = false;
            }
            if((i0->second == i1->second && i1->second==i2->second)){}
                
            }else{
                flag = false;
            }
        }else if(a.size()==2){
            auto i0 = a.begin();
            auto i1 = i0;
            i1++;
            if(i0->first==0||i1->first==0){

            }else{
                flag = false;
            }
            if(i0->second!=i1->second){
                flag = false;
            }
        }else{
            if(a.begin()->first!=0){
                flag = false;
            }
        }
    }
    if(!flag){

    }
    putYN(flag);

    return 0;
}