/*input

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;

#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")

#define F first
#define S second
#define mp make_pair
#define append push_back
#define mem(a,b) memset(a,b,sizeof(a))
#define ll long long int
#define pb push_back
#define print(a) cout<<a<<endl
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define all(x) x.begin(), x.end()
#define loop(i,n) for(int i = 0; i < n; i++)
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>void __f(const char* name, Arg1&& arg1){cout<<name<<" : "<<arg1<<"\n";}
template <typename Arg1, typename... Args>void __f(const char* names, Arg1&& arg1, Args&&... args)
{const char* comma=strchr(names+1,',');cout.write(names,comma-names)<<" : "<<arg1<<" , ";__f(comma+1, args...);} 
#define debugfor(x,a) { cerr<<#a<<": "; for(auto u : a) cerr<<u<<" "; cerr<<endl; }
//#define int long long int
 
const int MOD = 1e9 + 7;

int fastexpo(int x, int y) 
{ 
    int res = 1;
    x = x % MOD;
    while (y) 
    { 
        if (y & 1) res = (res*x) % MOD; 
        y = y>>1;
        x = (x*x) % MOD;   
    } 
    return res; 
}

void solve();

signed main(){
    
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    //cin>> t;
    while(t--){
        solve();
    }

    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}

void solve(){
    int n;
    cin>> n;
    vector<int> v(n);
    for(int i = 0; i < n; i++)
        cin>> v[i];
    sort(all(v));
    vector<int> ans;
    multiset<int> multi;
    ans.append(v[0]);
    for(int i = 1; i < n; i++)
        multi.insert(v[i]);
    bool flag = 0;
    for(int i = 1; i < n; i++){
        multi.erase(multi.find(v[i]));
        if(multi.find(ans[0]^v[i]) != multi.end()){
            ans.append(v[i]);
            flag = 1;
        }
        if(flag)
            break;
        multi.insert(v[i]);
    }
    if(!flag){
        print("No");
        exit(0);   
    }
    for(int i = 3; i < n; i++){
        if(multi.find(ans[ans.size()-1]^ans[ans.size()-2]) != multi.end()){
            ans.append(ans[ans.size()-1]^ans[ans.size()-2]);
            multi.erase(multi.find(ans[ans.size()-1]^ans[ans.size()-2]));
        }
        else{
            print("No");
            exit(0);
        }
    }
    if(ans[0]^ans[n-2] == ans[n-1]){
        print("Yes");
    }
    else
        print("No");
}