#include <bits/stdc++.h>

// {{{
#define PI pair<int, int>
#define mk make_pair
#define reg register
#define ll long long
#define rep(i, a, b) for(reg int i = a; i <= b; ++i)
#define per(i, a, b) for(reg int i = a; i >= b; --i)
// }}}

using namespace std;

inline int min(reg int a, reg int b) { return a < b ? a : b; }
inline int max(reg int a, reg int b) { return a > b ? a : b; }
inline int read() {
    reg int s = 0, f = 1; reg char ch = getchar();
    while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }
    while (isdigit(ch)) s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
    return s * f;
}

#define N 100005

int n;
int a[N];
map<int, int> mp;
vector<int>G;

int main() {
    n = read();
    int cnt = 0;
    rep (i, 1, n) {
        a[i] = read();
        if (mp[a[i]] == 0) {
            cnt++;
            G.push_back(a[i]);
        }
        mp[a[i]]++;
    }
    if (n == 3) {
        int now = a[1] ^ a[2];
        now ^= a[3];
        if (now == 0) puts("Yes");
        else puts("No");
        return 0;
    }
    if (n % 3 == 0) {
        int check = 1;
        sort(a + 1, a + n + 1);
        rep (i, 1, n / 3) {
            if (i == 1) continue;
            if (a[i] != a[i - 1]) check = 0;
        }
        rep (i, n / 3 + 1, n / 3 * 2) {
            if (i == n / 3 + 1) continue;
            if (a[i] != a[i - 1]) check = 0;
        }
        rep (i, n / 3 * 2 + 1, n) {
            if (i == n / 3 + 1) continue;
            if (a[i] != a[i - 1]) check = 0;
        }
        int now = a[1] ^ a[n];
        now ^= a[n / 3 + 1];
        if (now != 0) check = 0;
        if (check) puts("Yes");
        else puts("No");
        return 0;
    }
    if (mp[0] == n) puts("Yes");
    else puts("No");
    return 0; 
}

/*
 _____________________________________ 
< A.cpp is created by zrz who is weak >
 ------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
*/
