If the quantity of '1' in a number's binary digits is n, we call this number a n-onebit number. For instance, 8(1000) is a 1-onebit number, and 5(101) is a 2-onebit number. Now give you a number - n, please figure out the sum of n-onebit number belong to [0, R).
输入解释
Multiple test cases(less than 65). For each test case, there will only 1 line contains a non-negative integer n and a positive integer $R(n \leq 1000, 0 < R < 2^{1000})$, R is represented by binary digits, the data guarantee that there is no leading zeros.
输出解释
For each test case, print the answer module 1000000007 in one line.