pavaj

The alley in front of the school is of length L and has to be paved with rectangular shaped slabs, having a width equal to the width of the alley, but different lengths. There are n types of slabs, numbered from 1 to n, and there is a sufficiently large number of each type of slabs.

Task

Determine in how many ways the alley can be paved with the existing slabs.

Input Data

Input file pavaj.in contains on line one two positive integers separated by a space: L n, where L is the length of the alley and n is the number of types of slabs. On line two there are n non-zero positive integers each separated by a space, d1 d2 ... dn, where di represents the length of type i slabs for any i=1, n.

Output Data

Output file pavaj.out will contain a single line with a single positive integer, representing the number of ways the alley can be paved with the existing slabs.

Constraints and Statements

Examples
pavaj.in pavaj.out Explanation

5 3
2 1 3

13

The 13 paving methods are: (in red we represented the length 1 slabs, in cyan the length 2 slabs and in green the length 3 slabs).

         

       

       

       

       

     

     

     

     

     

     

   

   

Time limit: 0.3 seconds/test

prof. Marinel Serban
"Grigore Moisil" Iaşi IT High School
Contact:marinel_serban@yahoo.com