func_code_string: #include <bits/stdc++.h>   using namespace std;   const int M = 1e6 + 5, P = 1e9 + 7;   long long n, k, m, res, l, T, ans, mi;   int dp[2][M], A[M], B[M], sum[M];   int main() {     cin >> n >> l >> k;     for (int i = 1; i <= n; i++) {       scanf( %d , A + i);       B[i] = A[i];     }     sort(B + 1, B + 1 + n);     m = unique(B + 1, B + 1 + n) - B - 1;     for (int i = 1; i <= n; i++) A[i] = lower_bound(B + 1, B + 1 + m, A[i]) - B;     T = l / n;     res = l % n;     for (int i = 1; i <= n; i++) dp[1][A[i]]++;     ans = l % P;     for (int i = 2; i <= m; i++) dp[1][i] += dp[1][i - 1];     for (int i = 1; i <= m; i++) sum[i] += dp[1][i];     for (int lop = 2; lop <= min(1ll * k, T); lop++) {       int c = lop & 1;       for (int i = 1; i <= m; i++) dp[c][i] = 0;       for (int i = 1; i <= n; i++)         dp[c][A[i]] = (1ll * (dp[c][A[i]] % P) + 1ll * (dp[!c][A[i]] % P)) % P;       for (int i = 2; i <= m; i++)         dp[c][i] = (1ll * (dp[c][i] % P) + 1ll * (dp[c][i - 1] % P)) % P;       if (lop < k)         for (int i = 1; i <= m; i++)           sum[i] = (1ll * (sum[i] % P) + 1ll * (dp[c][i] % P)) % P;       long long len = (T - lop + 1) % P;       ans = (1ll * (ans % P) + 1ll * (len * dp[c][m] % P)) % P;     }     if (k >= 2 && T >= 1)       for (int i = 1; i <= res; i++)         ans = (1ll * (ans % P) + 1ll * (sum[A[i]] % P)) % P;     cout << ans << endl;   }   