#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include <utility>
#include <algorithm>
#include <math.h>

using namespace std;

#define ll long long

int main(){
    int N, ans = 0, index = 1, Max = 0;
    cin >> N;
    int a[N], b[N] = {}, count[N] = {};
    for(int i = 0; i < N; i++){
        cin >> a[i];
        ans ^= a[i];
        for(int j = 0; j < index; j++){
            if(b[j] == a[i]){
                count[j]++;
                break;
            }else if(j + 1 == index && b[j] != a[i]){
                b[index] = a[i];
                count[index] = 1;
                index++;
                break;
            }
        }
    }
    for(int i = 0; i < index; i++)Max = max(Max, count[i]);
    if(N%3 || ans || Max > N/3)cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}
