#include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; string yn(bool f){return f?"Yes":"No";} string YN(bool f){return f?"YES":"NO";} template vector> product(vector> &a, vector> &b){ vector> res(a.size(),vector(b[0].size(),0)); for(int i = 0; i < a.size(); i++){ for(int j = 0; j < b[0].size(); j++){ for(int k = 0; k < b.size(); k++){ res[i][j] += a[i][k]*b[k][j]; res[i][j] %= MOD; } } } return res; } template vector> matrix_power(vector> matrix, long long n){ vector> res(matrix.size(), vector(matrix.size(),0)); for(int i = 0; i < matrix.size(); i++) res[i][i] = 1; for( ; n > 0; n >>= 1){ if(n&1) res = product(res,matrix); matrix = product(matrix,matrix); } return res; } signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout< A; vector dp; vector> ans(2,vector(1)), mat(2, vector(2)); cin>>N>>W>>K; A.resize(N); dp.resize(W+2); for(int i = 0; i < N; i++){ cin>>A[i]; } dp[0] = 1; for(int i = 0; i < 2 * W; i++){ for(int j = 0; j < N; j++){ if(i+A[j] < dp.size()) dp[i+A[j]] = (dp[i+A[j]] + dp[i]) % MOD; } dp[i] %= MOD; } mat[0][0] = dp[W]; mat[0][1] = dp[W * 2]; mat[1][0] = 1; ans[0][0] = ans[1][0] = 1; mat = matrix_power(mat, K); ans = product(mat, ans); cout<