#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int i, j;
    int n;
    cin>>n;
    if(n%3!=0){
        bool ng = 0;
        for(i=0;i<n;i++){
            int a;
            cin>>a;
            if(a!=0) ng = 1;
        }
        if(ng) cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
    }
    else {
        map<int,int> ma;
        for(i=0;i<n;i++){
            int a;
            cin>>a;
            ma[a]++;
        }
        if(ma.size()==1){
            if(ma[0]==n) cout<<"Yes"<<endl;
            return 0;
        }
        if(ma.size()==2){
            if(ma[0]==n/3) cout<<"Yes"<<endl;
            return 0;
        }
        if(ma.size()==3){
            int x = 0;
            bool ok = 1;
            for(auto it=ma.begin();it!=ma.end();++it){
                x ^= it->first;
                if(it->second != n/3) ok = 0;
            }
            if(ok && x==0) cout<<"Yes"<<endl;
        }
        cout<<"No"<<endl;

    }
}