def f(n,aa):
    if sum(aa)==0:
        return "Yes"
    if n%3:
        return "No"
    sa=set(aa)
    if len(sa)!=3:
        return "No"
    n3=n/3
    for sak in sa:
        if aa.count(sak)!=n3:
            return "No"
    sa=list(sa)
    for i in range(3):
        if sa[i - 1] != sa[i - 2] ^ sa[i]:
            break
    else:
        return "Yes"
    return "No"

n=int(input())
aa=list(map(int,input().split()))
print(f(n,aa))
