There are restaurants in bagel-world. The restaurant serves distinct kind of bagels. Being a foodie you visit all the restaurants and in restaurant you order bagels. You have to tell the number of ways the order can be placed in the restaurant given that the count of any kind of bagel should always be less than . Two orders are considered different if there is atleast one kind of bagel whose count in the order is different. Since the answer can be large you have to output answer modulo .
Note: is a prime.
For the restaurant, there are kinds of bagels and the order consists of bagels. All the possible ways to make the order are: . So the answer is mod
Note: here represents that you order bagels of first kind and bagels of second kind.
For the restaurant the possible ways are: . So the answer is mod
For the restaurant the possible ways are: . So the answer is mod
Note: are NOT valid orders as count of any kind of bagel is always less than .
For the restaurant there are possible ways to order. So the answer is mod