A solarflare is a phenomenon where the sun suddenly releases a great amount of solar radiation, much more than normal. In total, there are n possible wavelengths of radiations and there are m different types of radiation . The total effect of solarflare is total number of distinct arrangement of wavelength of radiations. As the total number can be large , you have to report the answer mod 109+7 .
Arrangement A1,A2......An and B1,B2......Bn is said to be different if for any i, 1≤i≤n , Ai ≠ Bi
Input :
First line contains n and m
Next line contains an array of M elements, denoting number of radiations of ith type
Output :
Output Number of distinct arrangements modulo 109+7
Constraints
1≤n,m≤106
0≤Ai≤106
The possible arrangement can be
122
212
221