import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

bool calc(int[] a) {
    int[int] d;
    foreach (e; a) d[e]++;

    auto xs = new int[a.length];
    xs[1] = a[0]; // a[0] を固定
    for (int i = 1; i < a.length; i++) { // xs[0] を全探索
        xs[0] = a[i];

        int[int] d2;
        d2[a[0]]++;
        d2[a[i]]++;

        bool ok = true;
        // 残りを決める
        for (int j = 2; j < a.length; j++) {
            int x = a[j-1] ^ a[j-2];
            xs[j] = x;
            d2[x]++;
            if (x !in d) {
                ok = false;
                break;
            }

            if (d2[x] > d[x]) {
                ok = false;
                break;
            }
        }

        if (xs[0] != (xs[$-1] ^ xs[1])) ok = false;
        if (ok) return true;
    }

    return false;
}

void main() {
    readint;
    auto a = readints;
    writeln(calc(a) ? "Yes" : "No");
}
