#include<iostream> #include<vector> using namespace std; int solution(vector<int>& choice, int r, vector<int>& dp) { if (r < 0) return 0; if (dp[r] != 0 || r == 0) return dp[r]; long cur = 0; for (auto i : choice) { cur += solution(choice, r - i, dp); } if (cur >= 1e9 + 7) cur =cur % (long)(1e9 + 7); dp[r] = cur; return cur; } int main() { int n, m; cin >> n >> m; int t; vector<int> data; while (n-- && cin >> t) data.push_back(t); vector<int> dp(m+1, 0); dp[0] = 1; cout << solution(data, m, dp); }