import sys
from collections import Counter

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

b = list(Counter(a).items())
if sum(a) == 0:
    print("Yes")
    sys.exit()
    
if N % 3 == 0:
    if len(b) != 3:
        if len(b) == 2 and min(b[0][0], b[1][0]) == 0 and min(b[0][1], b[1][1]) == N // 3:
            print("Yes")
            sys.exit()
        print("No")
        sys.exit()
    c = [b[0][0], b[1][0], b[2][0], b[0][0], b[1][0]]
    for i in range(3):
        if c[i] != c[i+1] ^ c[i+2]:
            print("No")
            sys.exit()
    print("Yes")
else:
    print("No")