#include <bits/stdc++.h>
using namespace std;

const int MOD = 1000000007;
const int INF = 1000000000;

//long long
using ll = long long;

const long long lINF= ll(1e18) + 5;

//出力系
#define print(x) cout << x << endl
#define prints(x) cout << fixed << setprecision(10) << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

// a = max(a, b), a = min(a, b)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

//int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};

int main(){
    ll N;
    cin >> N;
    if(N % 3 != 0){
        no;
        return 0;
    }
    map<ll, ll> a;
    REP(i, N){
        ll x;
        cin >> x;
        a[x]++;
    }
    sort(all(a));
    bool flag = false;
    if(a.size() == 3){
        ll a[3];
        ll b[3];
        ll cnt = 0;
        for(auto d : a){
            a[cnt] = d.first;
            b[cnt] = d.second;
            cnt++;
        }
        if((a[0] ^ a[1]) == a[2] && (a[0] ^ a[2]) == a[1] && (a[1] ^ a[2]) == a[0]){
            if(b[0] == b[1] && b[1] == b[2]) flag = true;
        }
    }else if(a.size() == 2){
        ll a[2];
        ll b[2];
        ll cnt = 0;
        for(auto d : a){
            a[cnt] = d.first;
            b[cnt] = d.second;
            cnt++;
        }
    if(a[0] == 0 && b[0] == b[1] * 2) flag = true;

    }else if(a.size() == 1){
        if(a[0] == N) flag = true;
    }
    print(flag ? yes : no);
}
