#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
        int N;
        cin >> N;
        int a[N] = {0};
        for(int i = 0; i < N; i++) cin >> a[i];

        for(int i = 0; i < N-2; i++)
        {
                int b = a[i] ^ a[i+2];
                if(a[i+1] != b)
                {
                        cout << "No" << endl;
                        return 0;
                }
        }

        int c = a[1] ^ a[N-1];
        if(a[0] != c)
        {
                cout << "No" << endl;
                return 0;
        }

        int d = a[0] ^ a[N-2];
        if(a[N-1] != d)
        {
                cout << "No" << endl;
                return 0;
        }

        cout << "Yes" << endl;

        return 0;
}