#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mo = 1000000007;
const ll INF = 1LL << 59; //MAX 9223372036854775807
ll ans = 0;

int main()
{
ll n;
cin >> n;
ll t[n] = {};
rep(i, n){
    cin >> t[i];
}
if(n%3!=0){
    cout << "No" << endl;
    return 0;
}
ll cnt[32]={};
rep(i,n){
    rep(j,32){
        if(1LL&t[i]>>j)cnt[j]++;
    }
}
rep(i,32){
    if(cnt[i]==0||cnt[i]==n*2/3);
    else{
        cout << "No" << endl;
        return 0;
    }
}
cout << "Yes" << endl;
return 0;
}
