#pragma GCC optimize ("Ofast") #pragma GCC target ("avx2") #include using Int = long long; constexpr Int MO = 1000000007; int K, N; int X[100010]; Int dp[100010]; int main() { scanf("%d", &K); scanf("%d", &N); for (int i = 0; i < N; ++i) { scanf("%d", &X[i]); } X[N] = K + 1; dp[0] = 1; for (int x = 1; x <= K; ++x) { for (int i = 0; X[i] <= x; ++i) { dp[x] += dp[x - X[i]]; } dp[x] %= MO; } printf("%lld\n", dp[K]); return 0; }