#include <bits/stdc++.h>
const int mod=1e9+7;
using LL=long long;
using namespace std;
namespace ndifix{
template<class T> void sort(T &v){std::sort(v.begin(),v.end());}
template<class T> void rsort(T &v){std::sort(v.rbegin(),v.rend());}

}

int main(){
  int n;cin>>n;
  vector<int> a(n);for(int i=0;i<n;i++)cin>>a[i];
  set<int> s;
  for(int i=0;i<n;i++)s.insert(a[i]);
  ndifix::sort(a);

  if(s.size()==1){
    if(a[0]==0){cout<<"Yes"<<endl;return 0;}
    if(a[0]!=0){cout<<"No"<<endl;return 0;}
  }
  if(s.size()==2){
    if(n%3!=0){cout<<"No"<<endl;return 0;}
    int p,q,r;
    if(a[0]==a[2*n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+2*n/3);
    else if(a[n/3]==a[n-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin()+n/3,a.end());
    if(a[0]==a.back() && a[0]==0){cout<<"Yes"<<endl;return 0;}
    cout<<"No"<<endl;return 0;
  }
  if(s.size()==3){
    if(n%3!=0){cout<<"No"<<endl;return 0;}
    int p,q,r;
    p=a[0];
    if(a[0]!=a[n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+n/3);
    q=a[0];
    if(a[0]!=a[n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+n/3);
    r=a[0];
    if(a[0]!=a[n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+n/3);
    if((p^q)==r){cout<<"Yes"<<endl;return 0;}
  }
  cout<<"No"<<endl;
  return 0;
}
