#include<bits/stdc++.h>
        #define ll long long
        #define rep(i,a,b) for(i=a;i<b;i++)
        #define pb push_back
        #define all(v) v.begin(),v.end()
        #define F first
        #define S second
        #define CLR(a) memset((a),0,sizeof(a))
        #define mp make_pair
        #define hell 1000000007

        using namespace std;
         //int g[105][105];
        //vector < int > wt(100004);
       // vector < int > a;
        //vector < int > v(30500);
        //int cst[102][100005];
        //int ansr[100005];
     //ll int sum,x=0,c=0,n,m,flag=0,a1,a2,flag1=0,flag2=0;


         /* rep(i,0,50)
          {
              if(ck[i]) cout<<i<< " o"<<endl;
              else cout<<i<<" e"<<endl;
          }*/


        void solve()
        {
           ll int i,j=0,r=200,p,q,k=0,ans=0,d,y=0,h,flag=0,n,m=0,a,b,id,c,h1,h2,a1,b1;
           cin>>n;
           vector< ll int > v(n);
           set < ll int > s;
           rep(i,0,n) cin>>v[i],s.insert(v[i]),m^=v[i];
           map < ll int , ll int > mp;
           rep(i,0,n) mp[v[i]]++;
           sort(all(v));
           ll int c1=mp[v[0]];
           ll int c2=mp[v[n-1]];
           ll int c3=n-c1-c2;
           if(s.size()>3) {cout<<"No"; return;}
           if(s.size()==1)
           {
               if(v[0]==0 and v[n-1]==0) cout<<"Yes";
               else cout<<"No";
               return;
           }
           if(s.size()==2)
           {
               if(v[0]==0 and v[n-1])
               {
                   if(c1*2==c2) cout<<"Yes";
                   else cout<<"No";
                   return;
               }
               else cout<<"No";
               return;
           }
           if(n>3)
           {
               if(s.size()==3 and m==0 and n%3==0 and c1==c2 and c2==c3) cout<<"Yes";
               else cout<<"No";
               return;
           }
           else if(n==3){
           if(v[0]^v[1]==v[2] ) cout<<"Yes";
           else cout<<"No";
           return;
           }
           cout<<"No";


        }


        int main()
        {
            ios::sync_with_stdio(false);
            cin.tie(0);
            cout.tie(0);
            int t=1;
            //cin>>t;
            while(t--)
            solve();
        }

           /*

      void bfs( int i , int j)
           {
               vis[i][j]= true;
             queue < int > que;
             que.push(k);
             while(!que.empty())
             {
                int x= que.front();
                que.pop();
                 for ( int i=1;i<=n;i++)
                 {
                     if((!g[1][n] and g[x][i] ) or (g[1][n] and ! g[x][i]))
                     {
                       if(!vis[i])
                       {
                           que.push(i);
                           level[i]=level[x]+1;
                           vis[i]= true;
                       }
                     }
                 }
             }
           }

          ll int por(ll int a,ll int b)
             {
                ll int k=1;
                while(b>0)
                {
                    if(b%2) k=k*a,k%=hell;
                    b/=2;
                    a*=a; a%=hell;
                }
                return k;
             } */


Measured memory_bytes: 9344