N = int(input())
a = [int(_) for _ in input().split()]
a = sorted(a)

s = set(a)

if len(s) == 1:
    if a[0] == 0:
        print("Yes")
    else:
        print("No")
elif len(s) == 2:
    if N > 3:
        print("No")
    else:
        if a[0] == 0 and a[1] != 0:
            print("Yes")
        else:
            print("No")
elif len(s) == 3:
    if a[0] == 0:
        print("No")
    else:
        L = []
        for i in s:
            L.append(i)
        
        if L[0]^L[1] == L[2] and N % 3 == 0:
            p = a.count(L[0])
            q = a.count(L[1])
            r = a.count(L[2])
            if p == q and q == r:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
else:
    print("No")
            