#include <bits/stdc++.h>

#define F first
#define S second

using namespace std;
typedef long double ld;
typedef long long ll;

const int max_n = 100011, inf = 1000111222;
const ll inff = 1000111222333444;

int n, a[max_n], c[max_n];
map<int, int> mp;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n;
    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
        ++mp[a[i]];
    }
    if (n > 6 && n % 6 != 0) {
        cout << "No" << endl;
        return 0;
    }
    if (n % 6 == 0) {
        for (auto a : mp) {
            if (mn[a.F] % (n / 6) != 0) {
                cout << "No" << endl;
                return 0;
            }
            mp[a.F] /= n / 6;
        }
        n /= 6;
    }
    vector<int> b;
    for (auto a : mp) {
        for (int q = 0; q < a.S; ++q) {
            b.push_back(a.F);
        }
    }
    for (int i = 0; i < b.size(); ++i) {
        c[0] = b[i];
        for (int q = 0; q < b.size(); ++q) {
            if (i == q) continue;
            c[1] = b[q];
            for (int w = 1; w + 1 < n; ++w) {
                c[w + 1] = (w + 1) ^ c[w - 1];
            }
            if ((c[0] ^ c[n - 2]) == n && (c[1] ^ c[n - 1]) == 1) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}
