from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = dict(Counter(A))
val = list(c.values())
if N%3 != 0 or len(c) != 3 or val[0] != val[1] or val[1] != val[2]:
    print("No")
    exit(0)
a, b, c = list(c.keys())
if a ^ b == c and b ^ c == a and c ^ a == b:
    print("Yes")
else:
    print("No")
