//#define DEB1 //output check function
//#define DEB2 //same output, input from input.txt

#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <thread>
#include <mutex>
#include <iomanip>

#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define INF(a) memset(a, 0x3f, sizeof(a))
#define ALL(t) (t).begin(),(t).end()
#define FILL(a,c) fill(a, a+ sizeof(a)/sizeof(*a),c)
#define FILL2D(A,c) fill(A[0], A[0] +sizeof(A)/sizeof(**A),c)
#define FILL3D(A,c) fill(A[0][0], A[0][0] +sizeof(A)/sizeof(***A),c)
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define IN(a, x, b) (a<=x && x<b)
#define PB push_back

using namespace std;

using LL = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<LL,LL>;
using VI = vector<int>;
using VVI = vector<VI>;


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}


#ifdef DEB1
#define DPRINT(x) cout<< #x << "=" << (x) << endl; // print at debug mode
#else
#define DPRINT(x) ;
#endif
#ifdef DEB1
#define DCHECK(x) cout<< "debug check" << #x << endl;
#else
#define DCHECK(x) ;
#endif
 


/*
constant values
*/

//const int dx[] = {1,0,-1,0};
//const int dy[] = {0,1,0,-1};
//const int MX = 31001;

//const LL INF= 1LL<<60 ;//INF = 1001001001001; //1e9

// Main program
void solve(){
    //map
    int N;
    int a[4],c[3];
    int count=-1;
    cin >> N;
    REP(i,3){
        c[i]=1;
        a[i]=-1;
    }

    REP(i,N){
        int tmp;
        cin >> tmp;

        bool new_a = 1;
        REP(j,3){
            DPRINT(a[j])
            if(tmp==a[j]){
                ++c[j];
                new_a = 0;
            }
        }
        if(new_a) ++count;
        DPRINT(count)
        if(new_a) a[count] = tmp;
        DPRINT(a[count])

        if(count==3){
            cout << "No" << endl;
            return;
        }

    }
    if(count==0){
        if(a[0]==0){
            cout << "Yes" << endl;
            return;
        }
        else{
            cout << "No" <<endl;
            return;
        }
    }
    if(count==1){
        DCHECK()
        if(a[0]==0){
            (c[1]==c[0]*2)? cout << "Yes" <<endl: cout <<"No"<<endl;
            return;
        }
        if(a[1]==0){
            (c[0]==c[1]*2)? cout << "Yes" <<endl: cout <<"No"<<endl;
            return;
        }
        else{
            cout << "No" << endl;
            return;
        }
    }
    DPRINT(c[0]);
    DPRINT(c[1]);
    DPRINT(c[2]);

    int test;
    test = a[0]^a[1];
    DPRINT(test)
    if(c[0]==c[1] && c[1]==c[2] && test==a[2]){
        cout << "Yes" <<endl;
    }
    else{
        cout << "No" << endl;
    }
}



// ----------------------------------------------
int main() {

#ifdef DEB2
    cout << "DEBUG MODE"  << endl;
	ifstream in("input.txt"); //for debug
	cin.rdbuf(in.rdbuf()); //for debug
#endif

	int T=1; 

	for (int i = 0; i < T; ++i) {
		solve();
	}
}

Measured memory_bytes: 256