#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <limits>
#include <cassert>

using namespace std;

using i64 = long long int;
using u64 = std::uint_fast64_t;
using P = pair<i64, i64>;

struct edge {
    i64 from, to, cost;
    edge(i64 from, i64 to) : from(from), to(to), cost(1) {}
    edge(i64 from, i64 to, i64 cost) : from(from), to(to), cost(cost) {}
};
using Graph = vector<vector<edge>>;

constexpr i64 INF = std::numeric_limits<i64>::max();
constexpr i64 SINF = std::numeric_limits<i64>::max() / 10;
constexpr i64 MOD = 1000000007;
constexpr i64 dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };
//const i64 dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
//const i64 dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//const i64 dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

// http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
    for (auto& e : t) fill_v(e, v);
}

struct IoSetup {
    IoSetup() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;

int main() {
    i64 n;
    cin >> n;
    vector<i64> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    i64 x, y, z;
    x = a[0];
    i64 cnt= 1;
    bool flag = true;
    i64 xc, yc, zc;
    xc = yc = zc = 0;
    xc = 1;
    for (int i = 1; i < n; ++i) {
        if (cnt == 1) {
            if (a[i] != x) {
                y = a[i];
                ++cnt;
            }
            else {
                ++xc;
            }
        }
        else if (cnt == 2) {
            if (a[i] != y) {
                z = a[i];
                ++cnt;
            }
            else {
                ++yc;
            }
        }
        else {
            if (a[i] != z) {
                flag = false;
                break;
            }
            else {
                ++zc;
            }
        }
    }
    if (cnt == 1) {
        if(x == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
    }
    if (cnt == 2) {
        if (x == 0 && xc == 1 && yc == 2) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
    }
    if (cnt > 3) {
        cout << "No" << endl;
        return 0;
    }
    if (x ^ y != z || !flag) {
        cout << "No" << endl;
        return 0;
    }
    if(max({xc, yc, zc}) - min({xc, yc, zc}) <= 1) cout << "Yes" << endl;
    else cout << "No" << endl;
}

// a xor a - 0
//   a 0 a