
n = int(input())
ans = "No"
num_list = sorted([ int(v) for v in input().split() ])

if n % 3 == 0:
    m = n // 3
    a, b, c = num_list[0], num_list[m], num_list[2*m]
    if len(set(num_list[:m])) == 1 and len(set(num_list[m:2*m])) == 1 and len(set(num_list[2*m:])) == 1:
        if a ^ b == c:
            ans = "Yes"
print(ans)