Stones
Vasya has several flat stones, each with one side painted white and the other black. He has arranged them in a row with the black side facing down. Vasya cleverly realized that this arrangement represents a binary number. The conversion to a binary number is as follows: a stone with the white side up is considered zero, and a stone with the black side up is considered one. The first stone is assigned a coefficient of 1, the second stone a coefficient of 2, the third a coefficient of 4, and so on, doubling each time.
Vasya has a target number n that he wants to achieve. The only action he can take is to flip a segment of stones of non-zero length. When a segment is flipped, all stones in that segment are turned over, changing from black to white or from white to black. However, not all segments can be flipped. Vasya noticed that the segment being flipped also represents a binary number, and he can only flip those segments where the number they represent does not exceed k.
Moreover, Vasya wants each flipped segment to be unique, meaning no segment can be flipped more than once. He is interested in finding out how many different ways he can achieve a configuration of stones that corresponds to the number n. Since this number can be very large, the result should be given as the remainder when divided by 10^9 + 7.
Input
The first line of the input contains two numbers, n (1 ≤ n ≤ 10^18) and k (1 ≤ k ≤ 10^18), separated by a space.
Output
Output the number of ways to achieve the target configuration, modulo 10^9 + 7.