n = int(input())
a = list(map(int, input().split()))

if n % 3 != 0:
    if sum(a) == 0:
        print("Yes")
    else:
        print("No")
else:
    count = {}
    for i in range(n):
        count.setdefault(a[i], 0)
        count[a[i]] += 1
    num = list(count.keys())
    if len(num) != 3:
        print("No")
    else:
        if count[num[0]] == count[num[1]] and count[num[1]] == count[num[2]]:
            if num[0]^num[1] == num[2] and num[1]^num[2] == num[0] and num[2]^num[0] == num[1]:
                print("Yes")
            else:
                print("No")
        else:
            print("No")