#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
using ll = long long;
using ull = unsigned long long;

int main(void)
{
    IOS
    int n; cin >> n;
    map<int,int> m;
    REP(i,n) {
        int x; cin >> x;
        auto it = m.find(x);
        if (it = m.end()) m[x] = 0;
        m[x]++;
    }

    bool ans = false;

    if (m.size() == 1 && m.begin()->first == 0) ans = true;

    if (n % 3 == 0) {
        if (m.size() == 2 ) {
            for(auto kv : m) {
                if (kv.first == 0) {
                    if (kv.second * 3 == n ) ans = true;
                }
            }
        } else if (m.size() == 3) {
            vector<int> k;
            vector<int> v;
            for(auto kv : m) {
                k.emplace_back(kv.first);
                v.emplace_back(kv.second);
            }
            if (v[0] == v[1] && v[1] == v[2]) {
                if ((k[2] ^ k[1]) == k[0]) ans = true;
                if ((k[2] ^ k[0]) == k[1]) ans = true;
                if ((k[0] ^ k[1]) == k[2]) ans = true;
            }
        }
    }

    if (ans) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}