You are given infinite arrow-bundles, but there are exactly M distinct arrow-bundles. Let us denote them from 1 to M. An arrow-bundle is defined as a set of some number of arrows.
You are also given a target, on which you need to shoot exactly N arrows. In order to do this, you need to pick some arrow-bundles. If you pick some arrow-bundle, you have to use all its arrows and shoot it at the target.
If you can shoot N arrows at the target, you will receive a special gift from Rhezo. For shooting the arrows at target, you have to choose some sequence of arrow-bundles. You are pro at shooting arrows and never miss any shot.
You want to find the number of distinct ways of choosing some sequence of indices of arrow-bundles such that you will receive the gift from Rhezo. Two sequences of indices are distinct if they have different lengths or value at some index is not equal in them.
Input:
First line contains 2 space separated integers N and M. Next line contains M space separated integers where ith number denotes the number of arrows in ith arrow-bundle.
Output:
Please find the number of distinct ways in which you can get the special gift from Rhezo. As this number can be very large, output your answer modulo 109+7.
Constraints:
1≤N≤1018
1≤M≤100
1≤ Arrows in each arrow-bundle ≤100
40% tests have 1≤N≤10000
The 5 sequences are:
1.[1,1,1,1]
2.[2,1,1]
3.[1,2,1]
4.[1,1,2]
5.[2,2]