#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 5;
int n;
int z[N];
unordered_map <int, int> mp;
int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; ++i)
        scanf("%d", z + i);
    int c = 0;
    for (int i = 0; i < n; ++i)
    {
        if (mp[z[i]] == 0)
            ++c;
        ++mp[z[i]];
    }
    if (c == 1)
    {
        if (z[0] == 0)
            puts("Yes");
        else
            puts("No");
        return 0;
    }
    if (n % 3 != 0)
    {
        puts("No");
        return 0;
    }
    if (c != 3)
    {
        if (c == 2 && mp[0] = n / 3)
        {
            puts("Yes");
            return 0;
        }
        puts("No");
        return 0;
    }
    int f = 1;
    int ans = 0;
    for (int i = 0; i < n; ++i)
    {
        if (mp[z[i]] == 0)
            continue;
        ans ^= z[i];
        if (mp[z[i]] != n / 3)
            f = 0;
    }
    if (!f || ans != 0)
        puts("No");
    else
        puts("Yes");
    return 0;
}