Codeforces Round 593 (Div. 2)
B
Alice and the List of Presents
Codeforces
1500
原题
← AC →
翻译中…

Alice got many presents these days. So she decided to pack them into boxes and send them to her friends.

翻译中…

There are $n$ kinds of presents. Presents of one kind are identical (i.e. there is no way to distinguish two gifts of the same kind). Presents of different kinds are different (i.e. that is, two gifts of different kinds are distinguishable). The number of presents of each kind, that Alice has is very big, so we can consider Alice has an infinite number of gifts of each kind.

翻译中…

Also, there are $m$ boxes. All of them are for different people, so they are pairwise distinct (consider that the names of $m$ friends are written on the boxes). For example, putting the first kind of present into the first box but not into the second box, is different from putting the first kind of present into the second box but not into the first box.

翻译中…

Alice wants to pack presents with the following rules:

翻译中…
  • She won't pack more than one present of each kind into the same box, so each box should contain presents of different kinds (i.e. each box contains a subset of $n$ kinds, empty boxes are allowed);
  • For each kind at least one present should be packed into some box.
翻译中…

Now Alice wants to know how many different ways to pack the presents exists. Please, help her and calculate this number. Since the answer can be huge, output it by modulo $10^9+7$.

翻译中…

See examples and their notes for clarification.

翻译中…

Input

翻译中…

The first line contains two integers $n$ and $m$, separated by spaces ($1 \leq n,m \leq 10^9$) — the number of kinds of presents and the number of boxes that Alice has.

翻译中…

Output

翻译中…

Print one integer  — the number of ways to pack the presents with Alice's rules, calculated by modulo $10^9+7$

翻译中…

Note

翻译中…

In the first example, there are seven ways to pack presents:

翻译中…

$\{1\}\{\}\{\}$

翻译中…

$\{\}\{1\}\{\}$

翻译中…

$\{\}\{\}\{1\}$

翻译中…

$\{1\}\{1\}\{\}$

翻译中…

$\{\}\{1\}\{1\}$

翻译中…

$\{1\}\{\}\{1\}$

翻译中…

$\{1\}\{1\}\{1\}$

翻译中…

In the second example there are nine ways to pack presents:

翻译中…

$\{\}\{1,2\}$

翻译中…

$\{1\}\{2\}$

翻译中…

$\{1\}\{1,2\}$

翻译中…

$\{2\}\{1\}$

翻译中…

$\{2\}\{1,2\}$

翻译中…

$\{1,2\}\{\}$

翻译中…

$\{1,2\}\{1\}$

翻译中…

$\{1,2\}\{2\}$

翻译中…

$\{1,2\}\{1,2\}$

翻译中…

For example, the way $\{2\}\{2\}$ is wrong, because presents of the first kind should be used in the least one box.

翻译中…

样例

Input #1
1 3
Output #1
7
InputCopy OutputCopy
Input #2
2 2
Output #2
9
InputCopy OutputCopy
题目信息
题号
1236B
时间限制
1 s
内存限制
256 MB
标签
组合数学
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。