n = int(input())
a_list = list(map(int, input().split()))

ret_list = []
ret_list.append(a_list.pop(0))
ret_list.append(a_list.pop(0))

flag = True
while True:
    for_end = False
    ret_len = len(ret_list)
    mid_v = ret_list[ret_len-1]
    left_v = ret_list[ret_len-2]
    a_len = len(a_list)

    if a_len != 0:
        for i in range(a_len):
            tmp_right_v = a_list[i]
            side = left_v ^ tmp_right_v
            if side == mid_v:
                ret_list.append(a_list.pop(i))
                break

            if i == a_len-1:
                flag = False
    else:
        side = left_v ^ ret_list[0]
        if side != mid_v:
            flag = False
        else:
            break

    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')
