#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(const vector>& a, const vector>& b) { ll n = SZ(a); vector> res(n, vector(n, 0)); REP(i, n) REP(j, n) REP(k, n) { res[i][j] = (res[i][j] + (a[i][k] * b[k][j]) % MOD) % MOD; } return res; } vector> modpow(const vector>& a, ll b) { ll n = SZ(a); vector> ret(n, vector(n, 0)); 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(10000, 0), dp2(10000, 0); dp[0] = 1; REP(i, W) { REP(j, N) { (dp[i + a[j]] += dp[i]) %= MOD; } } dp2[0] = 1; REP(i, 2 * W) { REP(j, N) { if (i + a[j] == W || i == W) { continue; } (dp2[i + a[j]] += dp2[i]) %= MOD; } } vector> A(2, vector(2)); A[0][0] = dp[W]; A[0][1] = dp2[2 * W]; 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; }