#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> a;
ll bit[40];
ll main(){
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    ll N;
    cin>>N;
    for(ll i=0;i<N;i++){
      ll o;
      cin>>o;
      a.push_back(o);
    }
    for(ll i=0;i<N;i++){
      for(ll j=0;j<32;j++){
        if((a[i]&(1<<j)>0))bit[j]++;
      }
    }
    if(N%2==0){
      for(ll i=0;i<32;i++){
        if(bit[i]!=N/2){
          cout<<"No";
          return 0;
        }
      }
      cout<<"Yes";
      return 0;
    }
    for(ll i=0;i<32;i++){
      if(bit[i]!=N/2 && bit[i]!=N/2+1){
        cout<<"No";
        return 0;
      }
    }
    cout<<"Yes";
    return 0;
}
