Gifts#392

Gifts

1 second
64 megabytes
Very easy

Santa Claus wants to create unique gift sets, each consisting of exactly items. He has an unlimited supply of items from different classes (such as fruits, toys, cosmetics, etc.). Each class contains several categories of items; for example, the fruit class might include apples, oranges, pears, and so on. All items within a category are identical. Santa Claus wants to ensure that no set contains more than one item from the same class, meaning a set cannot include both an apple and an orange or two apples.

Your task is to write a program that calculates the number of distinct gift sets of items Santa Claus can assemble, given the number of classes and the number of categories within each class. Two gift sets are considered different if they include at least one item from different categories.

Input

The first line contains two integers and (0 < M \le N \le 10), separated by a space, representing the number of classes and the number of items in a set. The second line contains integers from to , separated by spaces, which indicate the number of categories in each class.

Output

Output a single integer representing the number of different gift sets of items that can be formed.

Examples

Example 1

Loading
Loading