n = int(input())
a = list(map(int, input().split()))
def doit(a):
    if len(a) % 3 != 0:
        return "No"
    c = {}
    for ai in a:
        c[ai] = c.get(ai, 0) + 1
    if len(c) > 3:
        return "No"
    k = list(sorted(c.keys()))
    if len(k) == 1:
        if k[0] == 0:
            return "Yes"
    if len(k) == 2:
        if k[0] == 0 and c[k[0]] * 2 == c[k[1]]:
            return "Yes"
    if len(k) == 3:
        if c[k[0]] == c[k[1]] == c[k[2]] and k[0] ^ k[1] == k[2]:
            return "Yes"
    return "No"

print(doit(sorted(a)))
