#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
using namespace std;
#define N (1000000000+7)
typedef pair<int,int> P;
typedef long long ll;
int d[1010][1010];
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
int h,w;
char board[1010][1010];
bool check(int i, int j) {
	return (i >= 0) && (i <= h) && (j >= 0) && (j <= w) && (board[i][j] == '.');
}

int main(void){
    int n,sum=0;
    cin>>n;
    vector<int>a(n),number;
    set<int>s;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
        number.push_back(a[i]);
        s.insert(a[i]);
    }
    if(sum==0){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(s.size()==3){
        sum=0;
        if(n%3!=0){
            cout<<"No"<<endl;
            return 0;
        }
        for(auto itr=s.begin();itr!=s.end();++itr){
            sum^=(*itr);
            if(number.count(*itr)!=n/3){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(sum==0)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
        return 0;
    }
    if(s.size()==2){
        sum=0;
        int v[2]={0};
        for(auto itr=s.begin();itr!=s.end();++itr){
            v[sum]=number.count(*itr);
            sum++;
        }
        if(((v[0]==n/3)&&(v[1]==2*n/3))||((v[0]==n/3)&&(v[1]==2*n/3))){
            cout<<"Yes"<<endl;
        }
        else cout<<"No"<<endl;
        return 0;
    }
    cout<<"No"<<endl;
    return 0;
}