#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <math.h>
#include <boost/math/common_factor_rt.hpp>
using namespace std;
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ll long long

int main(){
  ll N;
  cin >> N;
  ll a[100100];
  rep(i, N) cin >> a[i];
  ll sho;
  
  if(N%3!=0){
    cout << "No" << endl;
    return 0;
  }else{
    sho = N/3;
  }
  
  sort(a, a+N);
  
  ll flag = 1;
  FOR(i, 0, sho-1) if(a[i] != a[i+1]) flag = 0;
  FOR(i, sho, 2*sho-1) if(a[i] != a[i+1]) flag = 0;
  FOR(i, 2*sho, 3*sho-1) if(a[i] != a[i+1]) flag = 0;
  
  if(flag==0){
    cout << "No" << endl;
    return 0;
  }
  
  if(a[0]^a[sho]==a[sho*2] && a[0]^a[sho*2]==a[sho] && a[sho]^a[sho*2]==a[0]){
    cout << "Yes" << endl;
    return 0;
  }else{
    cout << "No" << endl;
    return 0;
  }
  
}