Link to this code: https://cses.fi/paste/adf1b5540ddf073e6456ca/
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int N, X;
	cin >> N >> X;

	const int M = 1000000007;

	vector<int> coins(N);

	for (int i = 0;i < N;++i) cin >> coins[i];

	vector<long long> dp(X + 1);
	dp[0] = 1;

	for (int i = 1;i < X + 1;++i) {
		for (int c : coins) {
			dp[i] += (i >= c) ? dp[i - c] % M: 0;
		}
		dp[i] = dp[i] % M;
	}

	cout << dp[X] << endl;
}