from collections import defaultdict
dic = defaultdict(int)
N = int(input())
a = list(map(int,input().split()))
t = 0
for i in range(N):
    t ^= a[i]
    dic[a[i]] += 1

if t != 0:
    print("No")
else:
    if N == 3:
        print("Yes")
    else:
        ks = dic.keys()
        if N % 3 == 0:
            if len(ks) > 3:
                print("No")
            elif len(ks) == 2:
                print("No")
            elif len(ks) == 1:
                print(print("Yes" if all([0 == x for x in a]) else "No"))
            else:
                ls = [dic[k] for k in ks]
                print("Yes" if ls[0] == ls[1] == ls[2] else "No")
        else:
            print("Yes" if all([0 == x for x in a]) else "No")