#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) cout << (x) << endl;
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INF = 1<<29;
const int MOD = 1000000007;
 
void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};


int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    ll N;
    cin >> N;
    vector<ll> a(N);
    map<ll,ll> m;
    rep(i,N) cin >> a[i], m[a[i]]++;
    if(N % 3 != 0 || m.size() == 1){
      rep(i,N){
        if(a[i]) print("No"), return 0;
      }
      print("Yes");
      return 0;
    }
    if(m.size() == 2){
      ll count = 0;
      rep(i,N) if(!a[i]) count++;
      if(count == N / 3) print("Yes"), return 0;
      print("No");
      return 0;
    }
    ll tmp = 0;
    if(m.size() == 3){
      for(auto itr = num.begin(); itr != num.end(); ++itr){
        if(itr->second() != N / 3) print("No"), return 0;
        tmp ^= itr->first;
      }
      if(!tmp) print("Yes"), return 0;
      print("No"), return 0;
    }
    if(m.size() > 3) print("No"), return 0;
}