Under construction

Still being built. Things may change

Sequence Transformation

Time limit10sMemory limit512 MB

Summary
Count length-n integer sequences with entries in [1, 2^k) whose prefix bitwise-OR values are strictly increasing, for n up to 1e18 and k up to 30000.
Level

Hard8 of 10

Topics
Combinatorics, Bit manipulation, Math, Dynamic programming
Solved
No attempts yet

Problem

Applying operation PP to the sequence A=a1,a2,…,anA = a_1, a_2, \dots, a_n produces the sequence B=b1,b2,…,bnB = b_1, b_2, \dots, b_n, where bi=a1∣a2∣⋯∣aib_i = a_1 \mathbin{|} a_2 \mathbin{|} \cdots \mathbin{|} a_i and ∣| is the bitwise OR operation.

Apply PP to every sequence of length nn whose entries are integers at least 11 and less than 2k2^k. Write a program that counts the sequences whose result is increasing, that is, b1<b2<⋯<bnb_1 < b_2 < \cdots < b_n.

Input

The first line contains nn and kk, separated by a space. (1≤n≤10181 \le n \le 10^{18}, 1≤k≤300001 \le k \le 30000)

Output

Print the number of such sequences modulo 109+710^9+7 on the first line.

Examples3

  1. Example 1

    Input
    1 2
    
    Expected output
    3
    
  2. Example 2

    Input
    2 3
    
    Expected output
    30
    
  3. Example 3

    Input
    3 3
    
    Expected output
    48