_ = input()
input_num = [int(i) for i in input().split(" ")]
input_size = len(input_num)-1


if sum(input_num)==0:
  print("Yes")
else:
    for i in range(len(input_num)):
        left = i-1
        right = i+1
        if left < 0:
            left = input_size
        if right > input_size:
          right = 0
    #     print(input_num[left])
    #     print(input_num[right])
        if (input_num[left]^input_num[right]) == input_num[i]:
            continue
        else:
            print("No")
            break
    else:
        print("Yes")