#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef double db;
typedef vector <ll> vll;
typedef pair <ll, ll> pll;
#define pb push_back
#define mp make_pair
#define MAX 1000000
#define mod 1000000007
#define all(_) _.begin(), _.end()
#define F first
#define S second
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    ll n, i;
    cin >> n;
    vll a(n);
    ll v = 0;
    map <ll, ll> m;
    for(i = 0; i < n; i++)
        cin >> a[i], m[a[i]]++;
    vll b;
    for(auto x : m)
        b.pb(x.F);
    bool p = true;
    if(b.size() < 3 || n % 3 != 0)
    {
        cout << "No\n";
        return 0;
    }
    else if((b[0] ^ b[1]) != b[2])
    {
        cout << "No\n";
        return 0;
    }
    for(i = 0; i < n; i++)
    {
        if(!m[b[i % 3]])
        {
            cout << "No\n";
            return 0;
        }
        m[b[i % 3]]--;
    }
    cout << ("Yes") << endl;
    return 0;
}