def resolve():
    n = int(input())
    aa = list(map(int, input().split()))

    flg = len(aa) % 3 == 0

    tmp1 = aa[0]
    tmp2 = aa[1]
    tmp3 = aa[2]

    if flg:
        flg = tmp1 == tmp2 ^ tmp3 and tmp2 == tmp1 ^ tmp3 and tmp3 == tmp1 ^ tmp2

    if flg:
        for a1,a2,a3 in zip(aa,aa[1:],aa[2:]):
            if not(a1 == tmp1 and a2 == tmp2 and a3 == tmp3):
                flg = False
                break

    print('Yes' if flg else 'No')
    
resolve()