2496.Transforming Sequence

Time Limit: 1s Memory Limit: 256MB

Let's define the transformation P of a sequence of integers a1,a2,...,an as b1,b2,...,bn, where bi=a1|a2|...|ai for all i=1,2,...,n, where | is the bitwise OR operation.

Vasya consequently applies the transformation P to all sequences of length n consisting of integers from 1 to 2k-1 inclusive. He wants to know how many of these sequences have such property that their transformation is a strictly increasing sequence. Help him to calculate this number modulo 109+7.

Input Format(From the terminal/stdin)

The only line of the input contains two integers n and k (1 \le n \le 1018,1 \le k \le 30000).

Output Format(To the terminal/stdout)

Print a single integer- the answer to the problem modulo 109+7.

Sample Input 1

Copy
1 2
 · \n

Sample Output 1

Copy
3
 \n

Sample Input 2

Copy
2 3
 · \n

Sample Output 2

Copy
30
  \n

Sample Input 3

Copy
3 3
 · \n

Sample Output 3

Copy
48
  \n

Submit

请先 登录

© 2025 FAQs