Grounded

Toby was behaving badly at little dog school and his teacher grounded him by asking him to solve a hard problem. Toby is given a number N, let’s consider a set S of all binary strings of N bits. Let’s also consider any subset Pi of S, let XOR(Pi) be the XOR of all the elements of Pi. The XOR of the empty set is a binary string of N zeros. As Toby is a very smart dog, and Toby’s teacher wants Toby to spend a very long time working on the problem, he asks: How many different subsets Pi of S exist such than XOR(Pi) has exactly K ones? Recall that the empty set and S itself are valid subsets of S. Input The input consist of several test cases. Each test case consists of a line containing the numbers N and K. The end of the test cases is given by the end of file (EOF). • 1 ≤ K ≤ N ≤ 106 Output For each test case print the requested answer modulo p = 109 + 7. Explication: For the first test case the subsets of the strings of 2 bits with an XOR with zero ones is: {}, {00}, {01, 10, 11} and {00, 01, 10, 11} For the second test case the subsets of the strings of 1 bit with an XOR with one is: {1}, {0, 1} Sample Input 20 11 Sample Output 4 2