std_n = int(input())
std_tuple = tuple(map(int, input().split()))
std_set = set(std_tuple)

if std_set == {0}:
    print("Yes")
elif len(std_set) == 2:
    if 0 in std_set:
        if std_tuple.count(0) * 3 == std_n:
            print("Yes")
        elif std_tuple.count(0) * 3 == std_n * 2:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
elif len(std_set) == 3:
    a, b, c = tuple(std_set)
    if std_tuple.count(a) == std_tuple.count(b) == std_tuple.count(c):
        if int(str(int(format(a, "b")) ^ int(format(b, "b"))), 2) == c:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
