#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N;
  cin >> N;
  map<int,int> cnt;
  rep(i,N){
    int a;
    cin >> a;
    cnt[a]++;
  }

  if(N%3 == 0){
    if(cnt.size() == 1){
      if(cnt[0] == N) cout << "Yes" << endl;
      else cout << "No" << endl;
    }
    else if(cnt.size() == 2){
      vector<pair<int,int>> v;
      FOR(it,cnt) v.emplace_back(*it);

      if(v[0].first == 0 && v[0].second == N/3) cout << "Yes" << endl;
      else cout << "No" << endl;
    }
    else if(cnt.size() == 3){
      vector<pair<int,int>> v;
      FOR(it,cnt) v.emplace_back(*it);

      if(v[0].second == v[1].second && v[1].second == v[2].second){
        int x = v[0].first;
        int y = v[1].first;
        int z = v[2].first;

        if(((x^y) == z && (x^z) == y) ||
           ((x^z) == y && (x^y) == z) ||
           ((y^z) == x && (y^x) == z) cout << "Yes" << endl;
        else cout << "No" << endl;
      }else{
        cout << "No" << endl;
      }
    }
    else cout << "No" << endl;

  }else{
    if(cnt[0] == N) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  
  return 0;
}
