import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } int max = n; int[] dp = new int[k + 1]; dp[0] = 1; for (int i = 0; i < k; i++) { for (int j = 0; j < max; j++) { if (i + arr[j] > k) { max = j; break; } dp[i + arr[j]] += dp[i]; dp[i + arr[j]] %= MOD; } } System.out.println(dp[k]); } }