mod = 1000000007 k = int(input()) n = int(input()) X = list(map(int, input().split())) li = [0] * (k + 1) li[0] = 1 for i in range(1, k + 1): for j in X: if i < j: break li[i] = (li[i] + li[i - j]) % mod print(li[k] % mod)