#pragma GCC optimize ("Ofast,unroll-loops") #pragma GCC target ("avx") #include constexpr int MO = 1000000007; int K, N; bool a[100010]; int dp[100010]; int main() { 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) { if (a[x]) { if ((dp[y + x] += c) >= MO) { dp[y + x] -= MO; } } } } printf("%d\n", dp[K]); return 0; }