Sets#253

Sets

2 seconds
256 megabytes
Medium

Given numbers and .

Let be the set of all numbers from to .

A set is a subset of if for every a\in A, also belongs to . The empty set () is a subset of any set.

It is necessary to find the value of the function f([n],k).

f([n],1) returns the number of subsets in the set .

f([n],k) where k>1 returns the sum f(s,k-1) where is a subset of .

Input

The first line contains two integers (1\le n,k \le 10^9).

Output

It is necessary to output f([n],k). Since the answer may be too large, output it modulo 10^9+7.

Examples

Example

Loading
Loading

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the first example, the set with element and k=1, so f(\{1\},1)=2 and .

In the second example, the set with elements and k=2. f(\{1,2\},2)=f(\{1,2\},1)+f(\{1\},1)+ +f(\{2\},1)+f(\{\emptyset\},1)=4+2+2+1=9.

Scoring

In this problem, there are conditional blocks. If your solution works correctly for certain constraints, it will receive a certain number of points. Note that the evaluation is still in the testing phase.

  1. ( points): k=1;

  2. ( points): n\le 10, k\le 2;

  3. ( points): n\le 15, k\le 3;

  4. ( points): without additional constraints.