Delicious Binary Strings

Given a binary string a0a1 . . . an−1, a delicious string b0b1 . . . bm−1 is defined to be another binary string with length m between 1 and n, such that for any number p with 0 ≤ p ≤ n − m, the quantity below is even. m−1 ∑ ap+k ∧ bk k=0 Herer ∧ means XOR. For this problem, calculate the total number of different delicious strings modulo 1000000007. Input A number (≤ 600) of binary strings S, one per line, where the length of S is between 1 and 50000. Output Output the answer for each test case, one on each line. Sample Input 10110 11100 Sample Output 24 23