#pragma GCC optimize ("Ofast") #pragma GCC optimize ("unroll-loops") #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) { Int tmp = 0; for (int i = 0; X[i] <= x; ++i) { tmp += dp[x - X[i]]; } dp[x] = tmp % MO; } printf("%d\n", dp[K]); return 0; }