Gifts
Santa Claus wants to create unique gift sets, each consisting of exactly M items. He has an unlimited supply of items from N 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 M 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 input consists of two integers N and M (0 < M ≤ N ≤ 10), separated by a space, representing the number of classes and the number of items in each set. The second line contains N integers, each ranging from 1 to 10, 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 M items that can be formed.