#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
 
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
 
 
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
 
#define int         long long
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define mp          make_pair
#define all(a)      (a).begin(),(a).end()
#define FF           first
#define SS           second
#define sz(x)       (int)x.size()
#define endl        '\n'
//#define hell          1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
// mp::cpp_int
 
const int hell=1000000007;
 
 
 int power(int a,int b)
 {
  if(b==1)return a%hell;
  if(b==0)return 1LL;
  int t=power(a,b/2);
   t%=hell;
   t*=t;
   t%=hell;
  if(b&1)
    return (t*a)%hell;
  else return t;

 }
int pw(int a,int b)
{
  int x=a;
  rep(i,1,b){a=a*x;
    a%=10000000000LL;}
  return a;
}
 
int gcd(int a,int b)
{   
  
  if(b==0)return a;
  return gcd(b-a%b,a%b);
}
 
bool cmp(pii a,pii b)
{
  return a.SS<b.SS;
}
 
 
int sum(int a,int b )
{
   int ans=a-a/b; 
   return ans;
}



 
int solve()
{  
    int n;
    cin>>n;
    vi a(n);
    rep(i,0,n)cin>>a[i];
   sort(all(a));

mi m; 
rep(i,0,n)m[a[i]]++;
   bool b=false;

if(m.size()==1)
{
  if(a[0]==0)b=true;
}

if(m.size()==2)
{
  if(a[0]==0)
    { 
      if(m[0]==n/2||m[0]==n-n/2)
      b=true;
    }

}

int x=0;
 
 vi ans;
if(m.size()==3)
{
   for(auto y:m)
     {
      x^=y.FF;
      ans.pb(y.FF);
    }
    if(x==0&&3*m[ans[0]]==n&&3*m[ans[1]]==n&&3*m[ans[2]]==n)b=true;

}   

if(b)cout<<"Yes";
else
  cout<<"No";

    return 0;
 
}
 
 
signed main()
{  int t=1;
//pri();
 ios::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
  
   cin.exceptions(cin.failbit);                                                                    
 
 


  clock_t time_req;
 
    // Without ung pow function
                                                                                                                   
 //cin>>t;
 
    int k=1;
     
   while(t--)
     {
      //cout<<"Case #"<<k<<":"<<" ";k++;
      solve();
     }
        exit(0);
 
         time_req = clock() - time_req;
    cout <<endl<< "Processor time taken is "
      << (double)time_req/CLOCKS_PER_SEC << " seconds" << endl;
 
 
    return 0;
} 