K = int(input()) N = int(input()) X = list(map(int, input().split())) import sys sys.setrecursionlimit(10 ** 9) P = 10 ** 9 + 7 note = [1] + [-1] * K import bisect def main(x): if note[x] != -1: return note[x] note[x] = 0 for i in range(bisect.bisect(X, x)): note[x] += main(x - X[i]) note[x] %= P return note[x] print(main(K))