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 xx in x: if i+xx <= K: DP[xx+i] = (DP[xx+i] + DP[i]) % (10**9+7) print(DP[K]%(10**9+7))