from collections import Counter


def main():
    N = int(input())
    A = list(map(int, input().split()))
    C = Counter(A)
    if N % 3 != 0:
        print("No")
        return
    if 0 in C and len(C) == 2:
        if C[0] * 3 == N:
            print("Yes")
            return
    elif 0 not in C and len(C) == 3:
        for c in C:
            if C[c] * 3 != N:
                print("No")
                return
            X = list(C)
            if X[0] ^ X[1] != X[2]:
                print("No")
                return
            print("Yes")
            return
    elif len(C) == 1 and 0 in C:
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()
