import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!int).array;

    if (N % 3 != 0) {
        writeln(A.map!(a => a == 0).all ? "Yes" : "No");
    } else {
        int[int] cnt;
        foreach (a; A) cnt[a] += 1;
        int[] B;
        foreach (k, v; cnt) {
            if (v % (N / 3) != 0) {
                writeln("No");
                return;
            }
            while (v > 0) {
                B ~= k;
                v -= N / 3;
            }
        }
        if (B.length != 3) {
            writeln("No");
            return;
        }
        if (B[0] != (B[1] ^ B[2])) {
            writeln("No");
            return;
        }
        writeln("Yes");
    }
}
