#include <bits/stdc++.h>
#define stop system("pause")
#define INP freopen("input.txt","r",stdin)
#define OUTP freopen("solve1.txt","w",stdout)
#define int long long
using namespace std;

typedef long long ll;

unordered_map<int,int> w;

main()
{
    ios_base::sync_with_stdio(0);
    int n; cin >> n;
    vector<int> v;
    set<int> s;
    int cnt = 0;
    if(n%3 != 0){
        cout << "No";
        return 0;
    }
    for(int i(0); i < n;i++){
        int x; cin >> x;
        s.insert(x);
        w[x]++;
        if(x == 0)cnt++;
    }
    if(cnt == n){
        cout << "Yes";
        return 0;
    }
    if(s.size() > 3){
        cout << "No";
        return 0;
    }
    if(s.size() == 3){
        int x = 0;
        for(auto&a : s)x^=a;
        if(x){
            cout << "No";
            return 0;
        }
        for(auto&a : s){
            if(w[a]!=n/3){
                cout << "No";
                return 0;
            }
        }
        cout << "Yes";
        return 0;
    }
    if(s.size() == 2 && !cnt){
        cout << "No";
        return 0;
    }
    int qwe = w[*(--s.end())];
    if(qwe!=2*n/3){
        cout << "No";
    }else cout << "Yes";
    return 0;
}
/*
*/

