#include <bits/stdc++.h>
using namespace std;
using cpx = complex<double>;
using namespace std::literals;
using Int = long long;
using Double = long double;
#ifdef __GNUG__
#define _GLIBCXX_DEBUG
#endif
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define LEN(x) ((int)(x).length())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define F first
#define S second
#define perm(c)   \
    sort(ALL(c)); \
    for (bool c##p = 1; c##p; c##p = next_permutation(ALL(c)))
vector<Int> IntsIn(int n) {
    auto v = vector<Int>(0);
    for (int i = 0; i < n; i++) {
        Int a;
        cin >> a;
        v.push_back(a);
    }
    return v;
}
template <typename T>
void Puts(T x) {
    cout << x << endl;
}
void setPrecision(int num = 20) {
    std::cout << std::fixed << std::setprecision(num);
}
template <typename T>
T Max(T a) {
    return a;
}
template <typename T, typename... Args>
T Max(T a, Args... args) {
    return std::max(Max(args...), a);
}
template <typename T>
T Min(T a) {
    return a;
}
template <typename T, typename... Args>
T Min(T a, Args... args) {
    return std::min(Min(args...), a);
}
template <typename T>
bool vector_contains(std::vector<T> vec, T value) {
    return (std::distance(vec.begin(), std::find(vec.begin(), vec.end(), value)) != vec.size());
}
template <typename T>
long indexOf(std::vector<T> &vec, const T &value) {
    auto result = std::distance(vec.begin(), std::find(vec.begin(), vec.end(), value));
    return ((long)result == (long)vec.size()) ? -1 : result;
}
template <typename T>
void removeAt(std::vector<T> &vec, unsigned int index) {
    vec.erase(vec.begin() + index);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &value) {
    std::fill((T *)array, (T *)(array + N), value);
}
int main() {
    int n;
    cin >> n;
    auto dict = map<Int, Int>();
    rep(i, n) {
        Int a;
        cin >> a;
        auto itr = dict.find(a);
        if (itr == dict.end()) {
            dict.insert(MP(a, 1));
        } else {
            itr->S++;
        }
    }
    if (SZ(dict) == 1) {
        auto itr = dict.begin();
        auto p = *itr;
        puts(p.F == 0 ? "Yes" : "No");
        return 0;
    }
    if (SZ(dict) == 2) {
        auto itr = dict.begin();
        auto p = *itr;
        itr++;
        auto q = *itr;
        if (p.F == 0) {
            puts(3 * p.S == n ? "Yes" : "No");
            return 0;
        } else if (q.F == 0) {
            puts(3 * q.S == n ? "Yes" : "No");
            return 0;
        } else {
            puts("No");
            return 0;
        }
    }
    if (!((n % 3 == 0) && SZ(dict) == 3)) {
        puts("No");
        return 0;
    }
    auto v = vector<Int>(0);
    for (auto &p : dict) {
        if (p.S != n / 3) {
            puts("No");
            return 0;
        }
        v.PB(p.F);
    }
    if (v[0] == (v[1] ^ v[2])) {
        puts("Yes");
    } else {
        puts("No");
    }
}


Measured memory_bytes: 5120