import itertools

n = int(input()) # The number of camel
a = [int(i) for i in input().split()] # Hat's number

def main():
    combs = list(itertools.permutations([i for i in range(1, n)]))
   
  	check = True
    for comb in combs:
        tmp = [0]
        tmp.extend(comb)
        for i in range(len(tmp)):
            idx = i
            if check:
                pre = idx - 1
                if pre < 0:
                    pre = n - 1
                
                if a[tmp[idx]] != a[tmp[pre]]^a[tmp[(idx + 1)%n]]:
                    check = False
            else:
                break

        if not check:
            break
    
    if check:
        print("Yes")
    else:
        print("No")

main()