K = int(input()) N = int(input()) x = list(map(int,input().split())) dp = [0]*(K+1) dp[0] = 1 for i in range(K): for j in range(N): if i + x[j] <= K: dp[i+x[j]] += dp[i] dp[i+x[j]] %= 10**9 + 7 print(dp[K])