#include <iostream>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
const int MOD = 1000000007;

int main(){
  ll N,a[100000]; 
  cin >> N;
  if(N%3 != 0) cout << "No";
  else{
    vector<P> vec;
    for(int i=0;i<N;i++){
      cin >> a[i];
      bool flag = true;
      for(int j=0;j<vec.size();j++){
        if(vec[j].first == a[i]) {
          vec[j].second++;
          flag = false;
        }
      }
      if(flag) vec.push_back(P(a[i], 1));
    }
    if(vec.size() == 1 && vec[0] == 0) {
      cout << "Yes";
      return 0;
    }
    else if(vec.size() == 2){
      if((vec[0].first == 0 && vec[0].second*2 == vec[1].second) || (vec[1].first == 0 && vec[1].second*2 == vec[0].second)){
        cout << "Yes";
        return 0;
      }
    }else if(vec.size() == 3){
      if(vec[0].first^vec[1].first == vec[2].first || vec[0].first^vec[2].first == vec[1].first){
        if(vec[0].second == vec[1].second && vec[1].second == vec[2].second){
          cout << "Yes";
          return 0;
        }
      }
    }
    cout << "No";
  }
}

