#C11026. Number of Ways to Prepare a Dish

    ID: 40297 Type: Default 1000ms 256MiB

Number of Ways to Prepare a Dish

Number of Ways to Prepare a Dish

You are given N distinct ingredients and you need to select exactly M ingredients in order to prepare a special dish. The number of ways to choose these ingredients is given by the binomial coefficient \(\binom{N}{M}\), which can be computed using the formula:

\[ \binom{N}{M} = \frac{N!}{M!(N-M)!} \pmod{10^9+7} \]

Your task is to compute \(\binom{N}{M}\) modulo \(10^9 + 7\). Although an array containing the ingredient values is provided as part of the input, the actual values are irrelevant; only the count matters.

inputFormat

The input is given via standard input and consists of:

  • A first line with two space-separated integers N and M, where N is the total number of ingredients, and M is the number of ingredients to choose.
  • A second line containing N space-separated integers representing the ingredients (these values are not used in the computation).

outputFormat

The output should be a single integer representing the number of ways to choose M ingredients out of N (i.e. \(\binom{N}{M}\)) computed modulo \(10^9+7\). The result should be printed to standard output.

## sample
5 3
1 2 3 4 5
10