How to find the number of subsets with a given length and XOR?

I have A (0<A<500000) elements (up to 10^6) in the set. I need to find in how many ways can I remove a subset, the size of which is a multiple of a given K (0<k<11) - K, 2K, 3K, etc. So that the XOR of what remains is 0.

• Welcome to Math.SE! You will frequently get better feedback from other users if you share your thoughts on the problem and what you have already attempted. – Ben Sheller Nov 16 '15 at 6:37
• I have attempted the brute-force attempt but I'm sure there is a mathematical way to go below O(n^2). – Chumanista Nov 16 '15 at 6:53