n = int(input())
a = [int(x) for x in input().split(' ')]

b = a
flg = 'No'
flgg = 'no'

for k in range(n-1) :
        # print(k)
        flgg = 'ok'

        for b in range(k+1,n-1) :
                flgg = 'no'

                # print(str(a[b]) + " " + str(a[k-1]) + " " + str(a[k]))

                if(a[b] ^ a[k-1] == a[k]) :
                        tmp = a[k+1]
                        a[k+1] = a[b]
                        a[b] = tmp
                        # print(a[k+1])
                        flgg = 'ok'
                        break
        else :
                if (flgg == 'no') :
                        break
else :
        if (flgg == 'ok') :
                flg = 'Yes'



print(flg)