import numpy as np mod = 1000000007 def convolution(a, b): n = len(a) m = len(b) l = n + m - 1 z = 1 << (l - 1).bit_length() ah, al = a >> 15, a & ((1 << 15) - 1) bh, bl = b >> 15, b & ((1 << 15) - 1) p = np.rint(np.fft.irfft(np.fft.rfft(al, z) * np.fft.rfft(bl, z))[:l]).astype(np.int64) r = np.rint(np.fft.irfft(np.fft.rfft(ah, z) * np.fft.rfft(bh, z))[:l]).astype(np.int64) q = np.rint(np.fft.irfft(np.fft.rfft(al + ah, z) * np.fft.rfft(bl + bh, z))[:l]).astype(np.int64) - p - r return ((p + (q << 15)) + (r << 30)) % mod #[x^n]P/Qを求める def poly_coef(Q, P, n): while n: R = np.empty_like(Q) R[::2] = Q[::2] R[1::2] = -Q[1::2] P = convolution(P, R) Q = convolution(Q, R) P = P[n & 1::2] Q = Q[::2] n >>= 1 return P[0] import sys input = sys.stdin.readline k = int(input()) n = int(input()) X = np.array(list(map(int, input().split()))) Q = np.zeros(k+1, dtype=np.int64) Q[0] = 1 Q[X] = -1 P = np.array([1]) ans = poly_coef(Q, P, k) print(ans)