#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;

using namespace std;

int main(){
    int N; cin >> N;
    vector<int> A(N);
    multiset<int> s;
    REP(i,N){
      cin >> A[i]; s.insert(A[i]);
    }
    int tmp = -1;
    vector<int> t;
    for(auto itr : s){
      if(tmp != itr){
        t.push_back(itr);
      }
      tmp = itr;
    }
    int size = t.size();
    if(size == 1){
       if(s.count(0) != 0) cout << "Yes";
       else cout << "No";
    }
    if(size == 2){
       if(N%3 == 0 && s.count(0) == N/3 && s.count(t[1]) == 2*N/3) cout << "Yes";
       else cout << "No";
    }
    if(size == 3){
       if(N%3 == 0 && s.count(t[0]) == N/3 && s.count(t[1]) == N/3 && s.count(t[2]) == N/3){
         if(t[0]^t[1]^r[2] == 0) cout << "Yes";
         else cout << "No";
       }else cout << "No";
      
    }
    if(size >= 4) cout << "No";
    
 	return 0; 
}