#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)

int main() {
  int n;cin>>n;
  map<int,int> mp;
  for(int i=0;i<n;++i){
    int a;cin>>a;
    if(mp.find(a)!= mp.end()){
      mp[a] +=1;
    } else {
      mp[a] =1;
    }
  }
  if(n%3==0){
    f(mp.size()==1){
      if(mp.begin()->first==0){
        cout << "Yes" << endl;
        return 0;
      }
    } else if(mp.size()==2){
      auto itr = mp.begin();
      int a1 = itr->first,cnt1 = itr->second;
      ++itr;
      int a2 = itr->first,cnt2 = itr->second;
      if(a1<a2){
        if(a1==0&&cnt1==n/3){
          cout << "Yes" << endl;
          return 0;
        }
      } else {
        if(a2==0&&cnt2==n/3){
          cout << "Yes" << endl;
          return 0;
        }
      }
    } else {
      auto itr = mp.begin();
      int a1 = itr->first,cnt1 = itr->second;
      ++itr;
      int a2 = itr->first,cnt2 = itr->second;
      ++itr;
      int a3 = itr->first,cnt3 = itr->second;
      if(a1^a2^a3==0&&cnt1==n/3&&cnt2==n/3&&cnt3==n/3){
        cout << "Yes" << endl;
        return 0;
      }
    }
  } else {
    if(mp.size()==1){
      if(mp.begin()->first==0){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No"<< endl;
  return 0;
}
