#pragma GCC optimize ("Ofast,unroll-loops") #pragma GCC target ("avx") #include using Int = long long; 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 = 1; y <= K; ++y) { Int tmp = 0; for (int x = 1; x <= y; ++x) { if (a[x]) { tmp += dp[y - x]; } } dp[y] = tmp % MO; } printf("%d\n", dp[K]); return 0; }