#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <deque>
#include <map>
using namespace std;

#define INF 1e18
#define int long long

signed main() {
    int n; cin >> n;
    map<int, int> mp;
    for(int i = 0; i < n; i++) {
        int a; cin >> a;
        mp[a]++;
    }

    if(mp[0] == n) {
        cout << "Yes" << endl;
        return 0;
    }

    if(n % 3 != 0) {
        cout << "No" << endl;
        return 0;
    }

    vector<int> cnt;
    for(auto& itr : mp) {
        for(int i = 0; i < itr.second / (n / 3); i++) {
            cnt.push_back(itr.first);
        }
    }

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