#include <bits/stdc++.h>

using namespace std;

#define INF 1000000007
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
signed main()
{
    int N;
    cin >> N;
    int a[N];
    vector<int> ans;
    rep(i, N)
    {
        cin >> a[i];
    }
    sort(a, a + N);
    if (N % 3 == 0)
    {
        ans.push_back(a[0]);
        for (int i = 1; i < N; i++)
        {
            if (a[i] != a[i - 1])
            {
                ans.push_back(a[i]);
            }
        }
        switch (ans.size())
        {
        case 1:
        {
            if (((ans[0] ^ a[0]) ^ a[0]) == 0)
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
            break;
        }
        case 2:
        {
            if (ans[0] == 0)
            {
                int x = 0, x0 = 0;
                rep(i, N)
                {
                    if (a[i] == 0)
                    {
                        x0++;
                    }
                    else
                    {
                        x++;
                    }
                }
                if (x == (2 * N / 3))
                {
                    cout << "Yes" << endl;
                }
                else
                {
                    cout << "No" << endl;
                }
            }
            else
            {
                cout << "No" << endl;
            }
            break;
        }
        case 3:
        {
            if (((ans[0] ^ ans[1]) ^ ans[2]) == 0)
            {
                int x1 = 1, x2 = 1, x3 = 1;
                int i = 1;
                for (; i < N; i++)
                {
                    if (a[i] != a[i - 1])
                    {
                        i++;
                        break;
                    }
                    x1++;
                }
                for (; i < N; i++)
                {
                    if (a[i] != a[i - 1])
                    {
                        i++;
                        break;
                    }
                    x2++;
                }
                for (; i < N; i++)
                {
                    if (a[i] != a[i - 1])
                    {
                        i++;
                        break;
                    }
                    x3++;
                }
                if ((x1 == x2) && (x2 == x3) && (x3 == (N / 3)))
                {
                    cout << "Yes" << endl;
                }
                else
                {
                    cout << "No" << endl;
                }
            }
            else
            {
                cout << "No" << endl;
            }
            break;
        }
        default:
        {
            cout << "No" << endl;
            break;
        }
        }
    }
    else
    {
        if ((a[0] == a[N - 1]) && (a[0] == 0))
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }
}


Measured memory_bytes: 2040