from collections import Counter
N = int(input())
A = list(map(int, input().split()))

if N % 3 != 0:
    ans = "Yes" if sum(A) == 0 else "No"
else:
    B = Counter(A)
    keys = tuple(B.keys())
    vals = tuple(B.values())
    if len(B) == 3:  # 3種類ならa^b^cかつNa==Nb==NCでおけ
        a, b, c = keys
        Na, Nb, Nc = vals
        if Na == Nb and Nb == Nc:
            a, b, c = keys
            ans = "No" if a ^ b ^ c else "Yes"
        else:
            ans = "No"
    elif len(B) == 2:  # 2種類なら、a^a==0かつb==0かつNa==2Nbでおけ
        a, b = keys
        Na, Nb = vals
        if a == 0:
            ans = "Yes" if Na == 2*Nb else "No"
        elif b == 0:
            ans = "Yes" if 2*Na == Nb else "No"
        else:
            ans = "No"
    elif len(B) == 1:
        a = keys[0]
        ans == "Yes" if a == 0 else "No"


print(ans)
