func_code_string: #include <bits/stdc++.h>   const int N = 1000001;   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n, m, k;     string s;     cin >> n >> k >> s;     m = s.size();     int last[200];     memset(last, -1, sizeof last);     for (int i = 0; i < m; i++) {       last[s[i]] = i;     }     pair<int, char> a[k];     for (int i = 0; i < k; i++) {       a[i] = make_pair(last[ a  + i],  a  + i);     }     sort(a, a + k);     int ind = 0;     for (int i = 0; i < n; i++) {       s += a[ind].second;       ind = (ind + 1) % k;     }     long long int dp[200];     memset(dp, 0, sizeof dp);     long long int t = 0;     for (char c : s) {       long long int h = dp[c];       dp[c] = (t + 1 + 1000000007) % 1000000007;       t = (t - h + dp[c] + 1000000007) % 1000000007;     }     cout << (t + 1) % 1000000007;   }   