#pragma GCC optimize ("Ofast,unroll-loops") #pragma GCC target ("avx") #include int main() { constexpr int MO = 1000000007; int K, N; int a[100010] = {}; int dp[100010] = {}; scanf("%d", &K); scanf("%d", &N); for (int i = 0; i < N; ++i) { int x; scanf("%d", &x); a[x] = 1; } dp[0] = 1; for (int y = 0; y < K; ++y) { const int c = dp[y]; for (int x = 1; x <= K - y; ++x) { dp[y + x] -= ((dp[y + x] += a[x] * c) >= MO) * MO; } } printf("%d\n", dp[K]); return 0; }