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

    flg = len(aa) % 3 == 0

    aa.sort()

    if flg:
        flg = aa[0] == aa[len(aa)//3 - 1] and aa[len(aa)//3] == aa[len(aa)//3*2 - 1] and aa[len(aa)//3*2] == aa[len(aa)-1]

    tmp1 = aa[0]
    tmp2 = aa[len(aa)//3]
    tmp3 = aa[len(aa)-1]

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

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