#P3214. [HNOI2011] 卡农

    ID: 2263 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>数学2011各省省选湖南组合数学逆元

[HNOI2011] 卡农

Description

As is well known, a canon is a polyphonic composition technique. While listening to canons, Xiao Yu had a burst of inspiration and invented a new rule for writing music.

He divides the sounds into nn notes and splits the music into several segments. Each segment is a harmony composed of 11 to nn notes, i.e., selecting some of the nn notes to play simultaneously.

To distinguish it from canons, he stipulates that the set of notes contained in any two segments must be different. To maintain regularity, he also requires that in one piece of music each note is sounded an even number of times across all segments.

Now the question is: how many pieces of music consisting of mm segments are there? Two pieces of music aa and bb are considered the same if and only if bb can be obtained by reordering the segments of aa. For example, suppose aa is {{1,2},{2,3}}\{\{1,2\},\{2,3\}\} and bb is {{2,3},{1,2}}\{\{2,3\},\{1,2\}\}, then aa and bb are the same music.

The answer should be taken modulo 108+710^8+7.

Input Format

One line containing two positive integers n,mn, m.

Output Format

Output one line with a single integer representing the answer.

2 3
1

Hint

Constraints
For 20%20\% of the testdata, 1n,m51 \le n, m \le 5.
For 50%50\% of the testdata, 1n,m30001 \le n, m \le 3000.
For 100%100\% of the testdata, 1n,m1061 \le n, m \le 10^6.

Sample Explanation
The music is {{1},{2},{1,2}}\{\{1\},\{2\},\{1,2\}\}.

Translated by ChatGPT 5