Killjee and chocolates

1

1 votes
Very-Easy
Problem

Killjee recently went to his old school and saw a student distributing chocolates on the occasion of his birthday.

The student had m type of chocolates and pi number of ith type of chocolates. There were n people whom he had to give chocolates but it was not necessary to give a chocolate to each person but as, it was his birthday he wanted to distribute all chocolates he had.

Killjee being a puzzled person wonders in how many ways the student can distribute all his chocolates.

As, you all know killjee is noob in both maths and coding so he is asking you all to help him.

Print the number of ways %109+7 as, the answer can be very large.

INPUT

First line of input contain two space separated integers n and m.

Next line contain m space separated integers number of chocolate of each type .

OUTPUT

Output a single integer, answer to the problem.

CONSTRAINTS

1n,m3000

1pi107

Sample Input
3 2
1 1
Sample Output
9
Time Limit: 2.5
Memory Limit: 256
Source Limit:
Explanation

Person 1 get all the chocolates.

Person 2 get all the chocolates

Person 3 get all the chocolates

Person 1 get only type 1 chocolate and person 2 get only 2nd type chocolate.

Person 1 get only type 1 chocolate and person 3 get only 2nd type chocolate.

Person 2 get only type 1 chocolate and person 1 get only 2nd type chocolate.

Person 2 get only type 1 chocolate and person 3 get only 2nd type chocolate.

Person 3 get only type 1 chocolate and person 1 get only 2nd type chocolate.

Person 3 get only type 1 chocolate and person 2 get only 2nd type chocolate.

Editor Image

?