#include #include #include #include #include #include #include #include #include #include using namespace std; #define int long long __int128_t MOD = 100000000; signed main() { MOD = 10 * MOD * MOD + 7; cin.tie(0); ios::sync_with_stdio(false); int N, M; cin >> N >> M; vector A(N, 0); A[0] = 1; vector X(M); for (int i = 0; i < M; i++) { cin >> X[i]; } for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { if (i + X[j] < N) { A[i + X[j]] = ((__int128_t)A[i + X[j]] + (__int128_t)A[i]) % MOD; } } } cout << A[N - 1] << endl; }