def resolve():

    n = int(input())
    dataset = set(map(int, input().split()))

    if len(dataset) == 1:
        if list(dataset)[0] == 0:
            print('Yes')
            return
        else:
            print('No')
            return

    li_dataset = list(dataset)
    xor = li_dataset[0] ^ li_dataset[1]

    flag = 0
    if xor in dataset:
        flag = 1

    if len(dataset) <= 3 and n % 3 == 0 and flag:
        print('Yes')

    else:
        print('No')
        
resolve()