n=int(raw_input())
a=sorted(map(int, raw_input().split()))

if a.count(0) == n:
    print "Yes"
elif n % 3 != 0:
    print "No"
else:
    if len(set(a[0:n/3])) == 1 and len(set(a[n/3:n/3*2])) == 1 and len(set(a[n/3*2:n])) == 1:
        if a[0] ^ a[n/3] == a[n/3*2]:
            print "Yes"
        else:
            print "No"
    else:
        print "No"
