#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(int X = 0; X < N; X++)

using namespace std;

int main(){

    int n;
    cin >> n;

    vector<int> a;
    map<int,int> m;

    rep(i,n){
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
        m[tmp]++;
    }

    bool ans = true;

    for(int i = 1, i <= n - 1; i++){
        ans = true;

        map<int, int> tmpm = m;
        int circle1 = a[0];
        int circle2 = a[i];

        tmpm[circle1] = 0;
        tmpm[circle2] = 0;

        for(int j = 0; j < n - 2; j++){
            int next = circle1 xor circle2;
            if(tmpm[next] != 1){
                circle1 = circle2
                tmpm[next]--;
                circle2 = next;

            }else{
                ans = false;
                break;

            }
        }

        if(ans){
            if(circle1 xor circle2 == a[0]){
                break;
            }
        }
    }

    if(ans){
        cout << "Yes" << endl;
    }else cout << "No" << endl;
    
    return 0;
}