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


int main(){
    int N;
    cin >> N;
    map<int, int> A;
    int a;
    for(int ii=0; ii<N; ii++){
        cin >> a;
        A[a]++;
    }
    if(A.size()>3){
        cout << "No" << endl;
        return 0;
    }

    vector<vector<int>> B;
    for(auto& a : A){
        B.push_back({a.first, a.second});
    }

    if(B.size()==1 && B[0][0] == 0){
        cout << "Yes" << endl;
        return 0;
    }
    if(B.size()==2 && B[0][0] == 0 && B[0][1] == B[1][1]){
        cout << "Yes" << endl;
        return 0;
    }
    if(B.size()==3 && B[0][0]^B[1][0]==B[2][0 && B[0][1] == B[1][1] && B[0][1] == B[2][1]){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}
