Given a sequence of integers \$A_1,A_2,A_3 ……A_n\$ , find number triples giving equal xor?

For giving sequence $$A_1,A_2,A_3 ……A_n$$ , find number of triples $$i,j,k$$ such that $$1<=i and $$A_i + A_{i+1} + … A_{j-1} = A_{j} + A_{j+1} ….. A_{k}$$ .Where $$+$$ is bitwise xor operation .

I tried to solve it using dynamic programming somewhat similar to https://www.geeksforgeeks.org/count-number-of-subsets-having-a-particular-xor-value/ , but it’s time complexity if $$O(n*m)$$ , where m is maximum element in the array .Can we do better than $$O(n*n)$$ or $$O(n*m)$$ ?