#P1096G. Lucky Tickets
Lucky Tickets
No submission language available for this problem.
Description
All bus tickets in Berland have their numbers. A number consists of digits ( is even). Only decimal digits can be used to form ticket numbers. If is among these digits, then numbers may have leading zeroes. For example, if and only digits and can be used, then , , are valid ticket numbers, and , , are not.
A ticket is lucky if the sum of first digits is equal to the sum of remaining digits.
Calculate the number of different lucky tickets in Berland. Since the answer may be big, print it modulo .
The first line contains two integers and — the number of digits in each ticket number, and the number of different decimal digits that may be used. is even.
The second line contains a sequence of pairwise distinct integers — the digits that may be used in ticket numbers. The digits are given in arbitrary order.
Print the number of lucky ticket numbers, taken modulo .
Input
The first line contains two integers and — the number of digits in each ticket number, and the number of different decimal digits that may be used. is even.
The second line contains a sequence of pairwise distinct integers — the digits that may be used in ticket numbers. The digits are given in arbitrary order.
Output
Print the number of lucky ticket numbers, taken modulo .
Samples
Note
In the first example there are lucky ticket numbers: , , , , and .
There is only one ticket number in the second example, it consists of digits . This ticket number is lucky, so the answer is .