#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int MOD = 1e9 + 7;
const int INF = 2e18;

signed main() {
    int N;
    cin >> N;
    vector<int> a(N);
    cin >> a;
    map<int, int> check;
    for (int i = 0; i < N; i++) check[a[i]]++;
    if (N % 3 != 0 && check.size() == 1 && check.begin()->first == 0) {
        cout << "Yes" << endl;
        return 0;
    } else if (N % 3 != 0) {
        cout << "No" << endl;
        return 0;
    }
    if (check.size() == 2 && check.begin()->first == 0 && check.begin()->second == N / 3) {
        cout << "Yes" << endl;
        return 0;
    } else if (check.size() == 3 && check.begin()->second == N / 3 && check.rbegin()->second == N / 3) {
        if (check.begin()->first xor next(check.begin(), 1)->first xor check.rbegin()->first == 0) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;

}
