#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
int main()
{
    int n;cin>>n;
    set<int>s;int tem;
    int s1=-1,s2=-1,s3=-1;
    int c1=1,c2=1,c3=1;
    REP(i,n){
        int fo=s.size();
        cin>>tem;s.insert(tem);
        if(s.size()>3){cout<<"No"<<endl;return 0;}
        if(fo==s.size())
        {   
            if(tem==s1)c1++;
            if(tem==s2)c2++;
            if(tem==s3)c3++;
        }else
        {
            if(s.size()==1)s1=tem;
            if(s.size()==2)s2=tem;
            if(s.size()==3)s3=tem;
        }
    }
    if(s.size()==3){
        if(!(c1==c2&&c2==c3)){cout<<"No"<<endl;return 0;}
        bitset<100>bs1=s1;
        bitset<100>bs2=s2;
        bitset<100>bs3=s3;
        bitset<100>temp=bs1^bs2;
        if(bs3!=temp){cout<<"No"<<endl;return 0;}
        cout<<"Yes"<<endl;return 0;
        }
    }
    else if(s.size()==2)
    {
        if(s1==0||s2==0)
        {
            if(s1==0&&c1*2==c2){cout<<"Yes"<<endl;return 0;}
            if(s2==0&&c2*2==c1){cout<<"Yes"<<endl;return 0;}
        }
    }
    else if(s.size()==1)
    {
        if(s1==0) cout<<"Yes"<<endl;return 0;
    }
    cout<<"No"<<endl;return 0;
}