#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#define LL long long
#define il inline
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fast_oi ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define CL(a,b) memset(a, b, sizeof(a))
using namespace std;
const int N = 1e5 + 7, MAXN = 1e6 + 7, INF = 0x3f3f3f3f;
LL fpow(LL a, LL b, LL p){LL ans = 1LL; while(b){if(b & 1) ans = ans * a % p; b >>= 1; a = a * a % p;} return ans % p;}
template <class T>
inline void read(T &ret){
    char c;ret = 0;
    while ((c = getchar()) < '0' || c > '9');
    while (c >= '0' && c <= '9'){
        ret = ret * 10 + (c - '0'), c = getchar();
    }
}
int n;
int a[N];
int main(){
    read(n);
    bool allzero = 1;
    for(int i = 1; i <= n; i ++){
        read(a[i]); allzero &= a[i] == 0;
    }
    if(allzero) { puts("Yes"); return 0;}
    if(n % 3) {puts("No");return 0;}
    sort(a + 1, a + n + 1);
    bool ok = 1;
    for(int i = 0; i <= 2; i ++){
        bool same = 1;
        for(int j = 2; j <= n / 3; j ++)
            same &= a[j + n / 3 * i] == a[j - 1 + n / 3  * i];
        if(!same) {ok = false;break;}
    }
    if(a[1] ^ a[1 + n / 3] ^ a[1 + 2 * n / 3] == 0 && ok) puts("Yes");
    else puts("No");
    return 0;
}
