#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
using ll = long long;

// 任意の隣接3項のビットごとの排他的論理和が0 <=> "Yes"
// => 3つおきに等しくなる

int main() {
    int N;
    cin >> N;
    vector<int>a(N);
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
    }

    int flag = 0;
    sort(a.begin(), a.end());

    if(a.back() == 0) flag = 1;
    if(N % 3 == 0){
        if(a[0] == a[N/3 - 1] && a[N/3] == a[(N/3)*2 - 1] && a[(N/3)*2] == a[N-1]){
            if(a[0] == 0){
                if(a[N/3] == a[(N/3)*2]) flag = 1;
            }else if(a[0] != a[N/3] && a[N/3] != a[(N/3)*2])
                if(a[0] ^ a[N/3] ^ a[(N/3)*2] == 0) flag = 1;
            }
        }
    }

    if(flag == 1){
        cout << "Yes";
    }else {
        cout << "No";
    }
    return 0;
}