#include using namespace std; using ll = long long; const ll MOD = 1000000007; ll modpow(ll x, ll n, ll mod = MOD) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); int K, n; cin >> K >> n; vector x(n); for (int i = 0; i < n; i++) cin >> x[i]; vector dp(K + 1, 0); dp[0] = 1; for (int i = 1; i <= K; i++) { for (int y : x) { if (i < y) break; (dp[i] += dp[i - y]) %= MOD; } } cout << dp[K] << endl; return 0; }