#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    vector<int>b(n);
    bool flag = false;

    for (tsumugi = 0; tsumugi < n -1; tsumugi++){
        for (matsuri = tsumugi; matsuri < n; matsuri++){
            if (a[0] ^ a[tsumugi] ^ a[matsuri] == 0){
                b[0] = a[0];
                b[1] = a[tsumugi];
                b[2] = b[matsuri];
                a[0] = 0;
                a[tsumugi] = 0;
                a[matsuri] = 0;
                flag = true;
                break;
            }
        if (flag == true)
            break;
        }
    }
    if (flag == false){
        cout << "No" << endl;
        return 0;
    }

    if (n < 4){
        cout << "Yes";
        return 0:;
    }

    //when n > 3
    int count_b = 0;

    for (tomoka = 0; tomoka < n - 3; tomoka++{
        flag = false;
        for (nao = 0; nao < n; nao++){
            if (a[nao] == 0)
                continue;
            if (b[count_b] ^ b[count_b + 1] ^ a[nao] == 0){
                b[count_b + 2] = a[nao];
                a[nao] = 0;
                count_b++;
                flag = true;
                break;
            }
        }
        if (flag == false){
            cout << "No" << endl;
            return 0;
        }
    }

    if (b[0] ^ b[n - 1] ^ b[n] == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0    
}