Problem: There are balls of different colors; the number of balls of the -th color is .
The balls can be combined into groups. Each group should contain at most balls, and no more than ball of each color.
Consider all sets of colors. For a set of colors, let's denote its value as the minimum number of groups the balls of those colors can be distributed into. For example, if there are three colors with , and balls respectively, they can be combined into groups (and not less than ), so the value of that set of colors is .
Your task is to calculate the sum of values over all possible sets of colors. Since the answer may be too large, print it modulo .
Input Format: The first line contains a single integer () — the number of colors.
The second line contains integers () — the number of balls of the -th color.
Additional constraint on input: the total number of balls doesn't exceed .
Output Format: Print a single integer — the sum of values of all sets of colors, taken modulo .
Note: Consider the first example. There are sets of colors:
- for the empty set, its value is ;
- for the set , its value is ;
- for the set , its value is ;
- for the set , its value is ;
- for the set , its value is ;
- for the set , its value is ;
- for the set , its value is ;
- for the set , its value is .
So, the sum of values over all sets of colors is .