#include <sstream>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<ctime>
#include<cmath>
#include<map>
#include<stack>
#include<random>
#include<queue>
#include<list>
#include<math.h>
#include<bitset>
#include<fstream>
using namespace std;
#define ll long long int
#define ld long double
#define key pair<ld,ld>
#define ii pair<int,int>
#define si set<int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int> >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define nu 100001
#define mul(x,y) ((ll)(x)*(y))%mod
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < int(n); i++)
#include<fstream>
const ll INF=9223372036854775807;
const ll mod=1000000007;
int  MOD(int  a, int  b)
{
    if(a>b)
        return a-b;
    else
        return b-a;
}
ll  max3(ll  a,ll  b, ll  c)
{
    return max(c,max(a,b));
}
ll min3(ll  a,ll  b,ll  c)
{
    return min(a,min(b,c));
}
ll  power(ll  x,ll  y,ll mod1)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x)%mod1;
        y = y>>1;
        x = (x*x)%mod1;
    }
    return res;
}
ll logg(ll  a)
{
    ll  x=0;
    while(a>1)
    {
        x++;
        a/=2;
    }
    return x;
}
ll  gcd(ll  a,ll   b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll abso(ll x)
{
    if(x<0)
    {
        return -x;
    }
    return x;
}
ll ceiling (ll  a,ll  b)
{
    if(a%b==0)
    {
        return a/b;
    }
    else
    {
        return a/b+1;
    }
}
ll modinv(ll x,ll p)
{
    return power(x,p-2,p);
}
void upd(int ind,vi &bit,int val)
{
    for(int j=ind;j<bit.size();j+=(j)&(-j))
    {
        bit[j]+=val;
    }
}
int query(int ind,vi &bit)
{
    int ret=0;
    for(int j=ind;j>0;j-=(j)&(-j))
    {
        ret+=bit[j];
    }
    return ret;
}
int main()
{
    int n;
    cin>>n;
    vi a(n);
    set<int> g;
    map<int,int> cnt;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        g.insert(a[i]);
        cnt[a[i]]++;
    }
    if(g.size()>3)
    {
        cout<<"No"<<endl;
    }
    else
    {
        if(g.size()==3)
        {
            int x=*g.begin();g.erase(g.begin());
            int y=*g.begin();g.erase(g.begin());
            int z=*g.begin();g.erase(g.begin());
            if((x^y)==z&&cnt[x]==cnt[y]&&cnt[y]==cnt[z])
            {
                cout<<"Yes"<<endl;
            }
            else
            {
                cout<<"No"<<endl;
            }
        }
        else
        {
            if(g.size()==2)
            {
                if(*g.begin()==0&&2*cnt[0]==cnt[*g.rbegin()])
                {
                    cout<<"Yes"<<endl;
                }
                else
                {
                    cout<<"No"<<endl;
                }
            }
            else
            {
                if(*g.begin()==0)
                {
                    cout<<"Yes"<<endl;
                }
                else
                {
                    cout<<"No"<<endl;
                }
            }
        }
    }
}


Measured memory_bytes: 7808