#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <boost/multi_array.hpp>


int main() {
    int n;
    std::cin >> n;
    
    int a[n];
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    
    // a^c = b <=> a^c^a = c^a^a = c^0 = c = b^a = a^b
    bool flag = true;
    for (int i = 0; i < n; i++) {
        int c = a[i]^a[(i+1)%n];
        if (c != a[(i+2)%n]) {
            flag = false;
            break;
        }
    }
    if (flag) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }
    return 0;
}
