#include using namespace std; typedef long long ll; typedef pair P; #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (ll i = m; i < n; i++) #define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define FOREACH(x, a) for (auto &(x) : (a)) #define ALL(v) (v).begin(), (v).end() #define SZ(x) ll(x.size()) const ll MOD = 1e9 + 7; vector> mul(vector> &a, vector> &b) { ll n = SZ(a); vector> res(n, vector(n, 0)); REP(i, n) REP(j, n) REP(k, n) { (res[i][j] += a[i][k] * b[k][j] % MOD) %= MOD; } return res; } vector> modpow(vector> &a, ll b) { ll n = SZ(a); vector> ret(n, vector(n)); if (b == 0) { REP(i, n) { ret[i][i] = 1; } return ret; } if (b % 2 == 0) { vector> t = modpow(a, b / 2); ret = mul(t, t); } else { vector> t = modpow(a, (b - 1) / 2); vector> u = mul(t, t); ret = mul(a, u); } return ret; } int main() { ll N, W, K; cin >> N >> W >> K; vector a(N); REP(i, N) { cin >> a[i]; } vector dp(1000, 0); dp[0] = 1; REP(i, 2 * W) { REP(j, N) { (dp[i + a[j]] += dp[i]) %= MOD; } } // REP(j, 2 * W + 1) { printf("%lld\n", dp[j]); } vector> A(2, vector(2)); A[0][0] = dp[W]; A[0][1] = dp[2 * W] + (MOD - (dp[W] * dp[W] % MOD)) % MOD; A[1][0] = 1; A[1][1] = 0; vector> C = modpow(A, K - 1); ll ans = dp[W] * C[0][0] % MOD + C[0][1] % MOD; cout << ans << endl; }