#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  vi A(n);
  map<ll,ll>MP;
  for(auto &a:A){cin>>a;MP[a]++;}
  vi num;
  vi num2;
  for(auto a:MP){
    num.pb(a.S);
    num2.pb(a.F);
  }
  if(MP.size()>=3){
    cout<<"No"<<endl;
  }else if(MP.size()==3){
    if(num[0]==num[1]&&num[1]==num[2]){
      if((num2[0]^num2[1]) == num2[2]&&
	 (num2[1]^num2[2]) == num2[0]&&
	 (num2[2]^num2[0]) == num2[1])
	cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }else cout<<"No"<<endl;
  }else if(MP.size()==2){
    if(num[0] == 2*num[1]){
      if(num2[0] == 0)cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }else if(2*num[0] = num[1]){
      if(num2[1] == 0)cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }else cout<<"No"<<endl;
  }else if(MP.size()==1){
    if(num2[0]==0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}
