#include<bits/stdc++.h>
#define int long long
using namespace std;
main(){
    int n;
    cin >> n;
    vector<int> v(n);
    if (n % 3 != 0){
        sort(v.begin(), v.end());
        if (v.back() == 0){
            cout << "Yes";
            return 0;
        }
        cout << "No" << endl;
        return 0;
    }
    map<int, int> tet;
    for (int i=0;i<n;i++) tet[v[i]]++;
    vector<int> kek;
    for (auto it = tet.begin(); it != tet.end(); it++){
        pair<int, int> p = *it;
        if (p.second % (n/3) != 0){
            cout << "No" << endl;
            return 0;
        }
        for (int i=0; i < p.second/(n/3); i++) kek.push_back(p.first);
    }
    if (kek[0]^kek[1]^kek[2] == 0){
        cout << "Yes";
    }
    else cout << "No";
    return 0;
}