from collections import Counter

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

mc = Counter(a).most_common()
ln = len(mc)

def detect():
    if ln == 1 and mc[0][0] == 0:
        return True
    elif ln == 2 and mc[1][0] == 0 and mc[1][1] == n // 3:
        return True
    elif ln == 3 and mc[0][0] ^ mc[1][0] ^ mc[2][0] == 0:
        return True

print("Yes" if detect() else "No")
