#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define f first
#define s second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int,ll> pil;
typedef tuple<int, int, int> tiii;
typedef tuple<int, int, int, int> ti4;
typedef long double ld;
typedef pair<ld, ld> pdd;
typedef tuple<ld, ld, vector<int> > tddi;
const ll mod = 1e9+7;

ll fact[300001];

ll power(ll base, ll expo){
    if(expo == 0ll){
        return 1ll;
    }
    ll val = power(base, expo / 2ll);
    if(expo % 2ll == 0){
        return (val * val) % mod;
    }
    else{
        return (((val * val) % mod) * base) % mod;
    }
}

inline ll invert(ll num){
    return power(num, mod - 2ll);
}

inline ll nCr(int n, int r){
    if(n < r){
        return 0ll;
    }
    return (((fact[n] * invert(fact[r])) % mod) * invert(fact[n - r])) % mod;
}

int N, K;
char str[100007];
ll toMult = 0ll;
ll sol = 0ll;

int main(){
    fact[0] = 1ll;
    for(int i = 1; i <= 200000; i++){
        fact[i] = fact[i-1] * ll(i);
        fact[i] %= mod;
    }
    scanf("%d %d", &N, &K);
    scanf("%s", str);
    for(int i = N - 1; i >= 0; i--){
        if(i >= K - 1 && i != N - 1){
            toMult += nCr(i, K - 1) * power(10ll, N - i - 2);
            toMult %= mod;
        }
        //cout << i << ' ' << toMult << endl;
        sol += toMult * ll(str[i] - '0');
        if(i >= K){
            sol += (ll(str[i] - '0') * nCr(i, K) % mod) *  power(10ll, N - i - 1);
            //cout << "+" << ll(str[i] - '0') * nCr(i, K) << endl;
        }
        sol %= mod;
    }
    cout << sol << endl;
    return 0;
}


#pragma comment(linker, "/STACK:256000000")
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <sstream>

using namespace std;

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define for1(i, n) for (int i = 1; i <= int(n); i++)
#define forv(i, v) forn(i, v.size())

#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair

#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;

const ll mod = 1000000009;
const int NMAX = 100005;

int n, k;

ll fact[NMAX];
ll inv[NMAX];
ll p10[NMAX];
ll cpk[NMAX], cpk1[NMAX];

ll gcd(ll a, ll b, ll &x, ll &y)
{
    //ax + by = gcd(a, b)
    if (b == 0)
    {
        x = 1; y = 0; return a;
    }
    else
    {
        ll x0, y0;
        ll d = gcd(b, a % b, x0, y0);
        x = y0; y = x0 - (a / b) * y0; return d;
    }
}

ll cnk(ll n, ll k)
{
    return (((fact[n] * inv[n - k]) % mod) * inv[k]) % mod;
}

ll inverse(ll a)
{
    ll x, y;
    gcd(a, mod, x, y);
    return ((x % mod) + mod) % mod;
}

void init()
{
    fact[0] = 1;
    for1(i, NMAX - 1) fact[i] = (fact[i - 1] * i) % mod;
    forn(i, NMAX) inv[i] = inverse(fact[i]);

    p10[0] = 1;
    for1(i, NMAX - 1) p10[i] = (p10[i - 1] * 10) % mod;

    for (int p = k; p < NMAX; p++)
        cpk[p] = cnk(p, k);
    for (int p = k + 1; p < NMAX; p++)
        cpk1[p] = cnk(p, k + 1);
}

string s;
int c[NMAX];

int main()
{
//    freopen(CIN_FILE, "rt", stdin);
//    freopen(COUT_FILE, "wt", stdout);

    scanf("%d %d\n", &n, &k);
    getline(cin, s);
    forv(i, s) c[i] = s[i] - '0';

    if (k == 0)
    {
        ll ans = 0;
        forn(i, n)
            ans = (ans * 10 + c[i]) % mod;
        cout << ans << endl;
        return 0;
    }

    k--;
    init();

    ll sum = 0;
    ll ans = 0;

    for (int p = n - 1; p >= 0; p--)
    {
        if (p < n - 1 && p >= k)
            sum = (sum + cpk[p] * p10[n - p - 2]) % mod;

        if (p > k)
            ans = (ans + c[p] * ((cpk1[p] * p10[n - p - 1]) % mod)) % mod;

        ans = (ans + c[p] * sum) % mod;
    }

    cout << ans << endl;

    return 0;
}


#pragma comment(linker, "/STACK:256000000")
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <sstream>

using namespace std;

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define for1(i, n) for (int i = 1; i <= int(n); i++)
#define forv(i, v) forn(i, v.size())

#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair

#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;

const ll mod = 1000000009;
const int NMAX = 100005;

int n, k;

ll fact[NMAX];
ll inv[NMAX];
ll p10[NMAX];
ll cpk[NMAX], cpk1[NMAX];

ll gcd(ll a, ll b, ll &x, ll &y)
{
    //ax + by = gcd(a, b)
    if (b == 0)
    {
        x = 1; y = 0; return a;
    }
    else
    {
        ll x0, y0;
        ll d = gcd(b, a % b, x0, y0);
        x = y0; y = x0 - (a / b) * y0; return d;
    }
}

ll cnk(ll n, ll k)
{
    return (((fact[n] * inv[n - k]) % mod) * inv[k]) % mod;
}

ll inverse(ll a)
{
    ll x, y;
    gcd(a, mod, x, y);
    return ((x % mod) + mod) % mod;
}

void init()
{
    fact[0] = 1;
    for1(i, NMAX - 1) fact[i] = (fact[i - 1] * i) % mod;
    forn(i, NMAX) inv[i] = inverse(fact[i]);

    p10[0] = 1;
    for1(i, NMAX - 1) p10[i] = (p10[i - 1] * 10) % mod;

    for (int p = k; p < NMAX; p++)
        cpk[p] = cnk(p, k);
    for (int p = k + 1; p < NMAX; p++)
        cpk1[p] = cnk(p, k + 1);
}

string s;
int c[NMAX];

int main()
{
//    freopen(CIN_FILE, "rt", stdin);
//    freopen(COUT_FILE, "wt", stdout);

    scanf("%d %d\n", &n, &k);
    getline(cin, s);
    forv(i, s) c[i] = s[i] - '0';

    k--;
    init();

    ll sum = 0;
    ll ans = 0;

    for (int p = n - 1; p >= 0; p--)
    {
        if (p < n - 1 && p >= k)
            sum = (sum + cpk[p] * p10[n - p - 2]) % mod;

        if (p > k)
            ans = (ans + c[p] * (cpk1[p] * p10[n - p - 1]) % mod) % mod;

        ans = (ans + c[p] * sum) % mod;
    }

    cout << ans << endl;

    return 0;
}


#pragma comment(linker, "/STACK:256000000")
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <sstream>

using namespace std;

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define for1(i, n) for (int i = 1; i <= int(n); i++)
#define forv(i, v) forn(i, v.size())

#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair

#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;

const ll mod = 1000000007;
const int NMAX = 100005;

int n, k;

ll fact[NMAX];
ll inv[NMAX];
ll p10[NMAX];
ll cpk[NMAX], cpk1[NMAX];

ll gcd(ll a, ll b, ll &x, ll &y)
{
    //ax + by = gcd(a, b)
    if (b == 0)
    {
        x = 1; y = 0; return a;
    }
    else
    {
        ll x0, y0;
        ll d = gcd(b, a % b, x0, y0);
        x = y0; y = x0 - (a / b) * y0; return d;
    }
}

ll cnk(ll n, ll k)
{
    return (((fact[n] * inv[n - k]) % mod) * inv[k]) % mod;
}

ll inverse(ll a)
{
    ll x, y;
    gcd(a, mod, x, y);
    return ((x % mod) + mod) % mod;
}

void init()
{
    fact[0] = 1;
    for1(i, NMAX - 1) fact[i] = (fact[i - 1] * i) % mod;
    forn(i, NMAX) inv[i] = inverse(fact[i]);

    p10[0] = 1;
    for1(i, NMAX - 1) p10[i] = (p10[i - 1] * 10) % mod;

    for (int p = k; p < NMAX; p++)
        cpk[p] = cnk(p, k);
    for (int p = k + 1; p < NMAX; p++)
        cpk1[p] = cnk(p, k + 1);
}

string s;
int c[NMAX];

int main()
{
//    freopen(CIN_FILE, "rt", stdin);
//    freopen(COUT_FILE, "wt", stdout);

    scanf("%d %d\n", &n, &k);
    getline(cin, s);
    forv(i, s) c[i] = s[i] - '0';

    if (k == 0)
    {
        ll ans = 0;
        forn(i, n)
            ans = (ans * 10 + c[i]) % mod;
        cout << ans << endl;
        return 0;
    }

    k--;
    init();

    ll sum = 0;
    ll ans = 0;

    for (int p = n - 1; p >= 0; p--)
    {
        if (p < n - 1 && p >= k)
            sum = (sum + cpk[p] * p10[n - p - 2]) % mod;

        if (p > k)
            ans = (ans + c[p] * ((cpk1[p] * p10[n - p - 1]) % mod)) % mod;

        ans = (ans + c[p] * sum) % mod;
    }

    cout << ans << endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

typedef long long ll;
const ll P = 1e9 + 7;
const int N = 1e5 + 5;

ll sum[N];

ll power(ll a, ll n) {
	if (n == 0) return 1LL;
	ll res = power(a, n / 2);
	res = res * res % P;
	if (n % 2) res = res * a % P;

	return  res;
}

ll mul(ll a, ll b) {
	return a * b % P;
}

ll divv(ll a, ll b) {
	return mul(a, power(b, P - 2));
}

ll summ(ll a, ll b) {
	return (a + b) % P;
}

int n, k;
string s;

int cnt[100][100];

vector<int> vect(int n, int k) {
	vector<int> res;
	if (k == -1) {
		for (int i = 0; i < n; i++) res.push_back(0);
	} else {
		for (int i = 0; i < k; i++) res.push_back(0);
		res.push_back(1);
		ll cur = 1LL;
		for (int i = k + 1; i < n; i++) {
			cur = divv(mul(cur, i), i - k);
			res.push_back(cur);
		}
	}
	return res;
}

void rec(int pos, int pluses, int pow, vector<int> dig) {
	dig.push_back(pow);
	if (pluses) {
		rec(pos + 1, pluses - 1, 0, dig);
	}
	if (pluses < n - pos - 1) {
		rec(pos + 1, pluses, pow + 1, dig);
	}
	if (pos == n - 1) {
		for (int i = 0; i < dig.size(); i++) {
			cnt[dig[i]][i]++;
		}
	}
}

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif

	cin >> n >> k;
	cin >> s;
	//rec(0, k, 0, vector<int>());
	//printf(" pos:");
	//for (int i = 0; i < n; i++) {
	//	printf("%5d", i);
	//}
	//printf("\n");
	//for (int i = 0; i < n; i++) {
	//	printf("%4d:", i);
	//	for (int j = 0; j < n; j++) {
	//		printf("%5d", cnt[i][n - j - 1]);
	//	}
	//	printf("\n");
	//}
	for (int i = 0; i < n; i++) {
		s[i] -= '0';
		sum[i + 1] = sum[i] + s[i];
	}
	vector<int> v1 = vect(n, k - 1), v2 = vect(n, k);
	v1.insert(v1.begin(), 0);
	//for (int i = 0; i < n; i++) {
	//	cout << v1[i] << " ";
	//}
	//cout << endl;
	//for (int i = 0; i < n; i++) {
	//	cout << v2[i] << " ";
	//}
	//cout << endl;
	ll ans = 0;
	ll base = 1;
	for (int i = 0; i < n; i++) {
		ll t = 0;
		t = summ(t, mul(s[n - i - 1], v2[n - i - 1]));
		t = summ(t, mul(sum[n - i - 1], v1[n - i - 1]));
		ans = summ(ans, mul(t, base));
		base = mul(base, 10);
	}
	cout << ans;

	return 0;
}


#include <iostream>
#include <string>
#include <cassert>

using namespace std;

typedef long long int64;

int64 const MOD = 1000000000 + 7;
int const MAXN = 100000 + 5;

int n, k;
string s;
int64 fact[MAXN];
int64 ten[MAXN];

int64 binPow(int64 x, int64 p)
{
    if (p == 0) return 1;
    if (p == 1) return x;
    int64 tmp = binPow(x, p / 2);
    tmp = (tmp * tmp) % MOD;
    if (p % 2 == 1)
        tmp = (tmp * x) % MOD;
    return tmp;
}

int64 inv(int64 x)
{
    return binPow(x, MOD - 2);
}

int64 c(int n, int k)
{
    if (n == k) return 1;
    if (k < 0 || n == 0 || n < k) return 0;
    return (fact[n] * inv((fact[k] * fact[n - k]) % MOD)) % MOD;
}

void init()
{
    fact[0] = 1;
    ten[0] = 1;
    for (int i = 1; i < MAXN; ++i) {
        fact[i] = (fact[i - 1] * i) % MOD;
        ten[i] = (ten[i - 1] * 10) % MOD;
    }
}

int dig(char c)
{
    assert(c >= '0' && c <= '9');
    return c - '0';
}

int main()
{
    init();

    cin >> n >> k;
    cin >> s;

    int64 res = 0;
    for (int i = 0; i < n; ++i) {
        res += dig(s[i]) * ten[n - i - 1] * c(i, k);
        res %= MOD;
    }

    int64 p = 0;
    for (int i = 0; i < n - 1; ++i) {
        p = (p + ten[i] * c(n - i - 2, k - 1)) % MOD;
        res += dig(s[n - i - 2]) * p;
        res %= MOD;
    }

    cout << res << endl;

    return 0;
}


#include <iostream>
#include <string>
#include <cassert>

using namespace std;

typedef long long int64;

int64 const MOD = 1000000000 + 7;
int const MAXN = 100000 + 5;

int n, k;
string s;
int64 fact[MAXN];
int64 ten[MAXN];

int64 binPow(int64 x, int64 p)
{
    if (p == 0) return 1;
    if (p == 1) return x;
    int64 tmp = binPow(x, p / 2);
    tmp = (tmp * tmp) % MOD;
    if (p % 2 == 1)
        tmp = (tmp * x) % MOD;
    return tmp;
}

int64 inv(int64 x)
{
    return binPow(x, MOD - 2);
}

int64 c(int n, int k)
{
    if (n == k) return 1;
    if (n == 0 || n < k) return 0;
    return (fact[n] * inv((fact[k] * fact[n - k]) % MOD)) % MOD;
}

void init()
{
    fact[0] = 1;
    ten[0] = 1;
    for (int i = 1; i < MAXN; ++i) {
        fact[i] = (fact[i - 1] * i) % MOD;
        ten[i] = (ten[i - 1] * 10) % MOD;
    }
}

int dig(char c)
{
    assert(c >= '0' && c <= '9');
    return c - '0';
}

int main()
{
    init();

    cin >> n >> k;
    cin >> s;

    int64 res = 0;
    for (int i = 0; i < n; ++i) {
        res += dig(s[i]) * ten[n - i - 1] * c(i, k);
        res %= MOD;
    }

    int64 p = 0;
    for (int i = 0; i < n - 1; ++i) {
        p = (p + ten[i] * c(n - i - 2, k - 1)) % MOD;
        res += dig(s[n - i - 2]) * p;
        res %= MOD;
    }

    cout << res << endl;

    return 0;
}


										/* in the name of Allah */
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <list>
#include <map>
#include <set>

using namespace std;

#define uint unsigned int
#define int64 long long
#define P pair<int, int>
#define Pss pair<string, string>
#define PLL pair<int64, int64>
#define Inf 1000000
#define Mod 1000000007LL

int n, k;
int64 pw[100010];
int64 fact[100010];
int64 s[100010];
string str;

int64 modP(int64 x, int64 y){
	int64 ret = 1;
	while(y){
		if(y % 2)
			ret = (ret * x) % Mod;
		x = (x * x) % Mod;
		y /= 2;
	}
	return ret;
}

int64 sel(int64 a, int64 b){
	if(a < 0 || a > b)
		return 0;
	int64 res = fact[b];
	res = (res * modP(fact[a], Mod - 2)) % Mod;
	res = (res * modP(fact[b - a], Mod - 2)) % Mod;
	return res;
}

int main(){
	cin >> n >> k >> str;
	reverse(str.begin(), str.end());
	pw[0] = 1;
	fact[0] = 1;
	for(int i = 1; i <= n; i++){
		pw[i] = (pw[i - 1] * 10) % Mod;
		fact[i] = (fact[i - 1] * i) % Mod;
	}

	int64 res = (sel(k, n - 1) * (str[0] - '0')) % Mod;
	for(int i = 1; i < n; i++){
		s[i] = (s[i - 1] + pw[i - 1] * sel(k - 1, n - 1 - i)) % Mod;
		int64 t = (s[i] + pw[i] * sel(k, n - 1 - i)) % Mod;
		res = (res + t * (str[i] - '0')) % Mod;
	}
	cout << res << endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long ll;
typedef pair<int, int> pii;
#define X first
#define Y second
#define mp make_pair

ll mod = (ll)1e9 + 7;
const int N = (int)1e5 + 100;
char str[N];
ll fact[N];
ll rFact[N];
ll sum[N];

ll myPow(ll x, ll k)
{
	if (k == 0)
		return 1;
	if (k & 1)
		return (x * myPow(x, k - 1)) % mod;
	ll t = myPow(x, k / 2);
	return (t * t) % mod;
}

void init()
{
	fact[0] = 1;
	for (int i = 1; i < N; i++)
		fact[i] = (fact[i - 1] * i) % mod;
	for (int i = 0; i < N; i++)
		rFact[i] = myPow(fact[i], mod - 2);
}

ll getC(int n, int k)
{
	if (n < k || n < 0 || k < 0)
		return 0;
	ll res = (fact[n] * rFact[k]) % mod;
	res = (res * rFact[n - k]) % mod;
	return res;
}

int main()
{
#ifdef LOCAL
	freopen ("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);
#endif

	init();
	int n, k;
	scanf("%d%d", &n, &k);
	scanf(" %s", str);

	ll pow10 = 1;
	for (int cnt = 1; cnt <= n; cnt++)
	{
		ll added = (getC(n - cnt - 1, k - 1) * pow10) % mod;
		sum[cnt] = (sum[cnt - 1] + added) % mod;

		pow10 = (pow10 * 10) % mod;
	}

	ll answer = 0;
	for (int i = 0; i < n; i++)
	{
		int d = str[i] - '0';
		int cnt = n - i - 1;
		answer = (answer + d * sum[cnt]) % mod;
	}
	ll number = 0;
	pow10 = 1;
	for (int i = n - 1; i >= 0; i--)
	{
		int len = n - i;
		int d = str[i] - '0';
		number = (number + d * pow10) % mod;
		int newN = n - 1 - len;
		int newK = k - 1;
		if (i == 0)
		{
			newN = 0;
			newK = k;
		}

		ll value = (number * getC(newN, newK)) % mod;
		answer = (answer + value) % mod;
		pow10 = (pow10 * 10) % mod;
	}
	cout << answer;

	return 0;
}


#pragma comment(linker,"/STACK:102400000,102400000")
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<cstdio>
#include<queue>
#include<map>
#include<set>
#include<time.h>
#include<cstdlib>
#include<list>
#include<cstring>
#include<iterator>
#include<fstream>
#include<sstream>
using namespace std;
#define inf 1888888888
#define PI acos(-1.0)
#define FIR 1,n,1
#define LEFT l,mid,dq<<1
#define RIGHT mid+1,r,dq<<1|1
#define L (dq<<1)
#define R (dq<<1|1)
#define DQ l,r,dq
#define MID (l+r)>>1
#define LL __int64
template<class _T> inline _T loww(_T n){return n&(-n);}
template<class _T> inline void swapp(_T &x,_T &y){_T t;t=x,x=y,y=t;}
template<class _T> inline _T minn(_T i,_T j){return i>j?j:i;}
template<class _T> inline _T maxx(_T i,_T j){return i>j?i:j;}
template<class _T> inline _T gcd(_T b,_T c){return b&&c?(c?gcd(c,b%c):b):b|c;}
template<class _T> inline _T abss(_T b){return b>0?b:-b;}
const LL p=1000000007;
LL P(LL x,LL y)
{
	LL s=1;
	while(y)
	{
		if(y&1)
			s=s*x%p;
		x=x*x%p;
		y>>=1;
	}
	return s;
}
LL U(LL n)
{
	return P(n,p-2)%p;
}

const LL N=100005;
char c[N];
LL fact[N];
LL Ck1[N],Ck2[N],ten[N];
LL dp[N],dpp[N][2];
LL C(LL n,LL k){
	return fact[n]*U(fact[k]*fact[n-k]%p)%p;
}
int main(){
	LL n,k,i,s=0,b,sum=0;
	scanf("%I64d%I64d",&n,&k);
	scanf("%s",c);
	fact[0]=1;
	ten[0]=1;
	for(i=1;i<N;i++){
		fact[i]=fact[i-1]*i%p;
		ten[i]=ten[i-1]*10%p;
	}
	for(i=0;i<N;i++){
		if(k-1<0||i<k-1)Ck1[i]=0;
		else Ck1[i]=C(i,k-1);
		if(k-2<0||i<k-2)Ck2[i]=0;
		else Ck2[i]=C(i,k-2);
	}
	b=0;
	for(i=0;i<n-1;i++){
		b=(b*10+c[i]-'0')%p;
		s=(s+b*Ck1[n-2-i])%p;
	}
	b=(b*10+c[i]-'0')%p;
	if(k==0)
		s=(s+b)%p;
	b=0;
	for(i=n-1;i>0;i--){
		b=(b+(c[i]-'0')*ten[n-1-i])%p;
		s=(s+b*Ck1[i-1])%p;
	}
	for(i=1;i<n-1;i++)
		sum=(sum+c[i]-'0')%p;
	dp[1]=sum;dpp[1][0]=c[1]-'0';dpp[1][1]=c[n-2]-'0';
	dpp[n-1][0]=0;
	for(i=n-2;i>=1;i--){
		dpp[i][0]=(dpp[i+1][0]+(c[i]-'0'))%p;
	}
	for(i=2;i<=n-2;i++){
		dpp[i][1]=(dpp[i-1][1]+(c[n-1-i]-'0')*ten[i-1]%p)%p;
		dp[i]=((dp[i-1]-dpp[i-1][1])*10+dpp[i][0])%p;
		if(dp[i]<0)dp[i]+=p;
	}
	for(i=1;i<=n-2;i++){
		s=(s+dp[i]*Ck2[n-2-i]%p)%p;
	}
	printf("%I64d\n",s);

}


#pragma comment(linker,"/STACK:102400000,102400000")
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<cstdio>
#include<queue>
#include<map>
#include<set>
#include<time.h>
#include<cstdlib>
#include<list>
#include<cstring>
#include<iterator>
#include<fstream>
#include<sstream>
using namespace std;
#define inf 1888888888
#define PI acos(-1.0)
#define FIR 1,n,1
#define LEFT l,mid,dq<<1
#define RIGHT mid+1,r,dq<<1|1
#define L (dq<<1)
#define R (dq<<1|1)
#define DQ l,r,dq
#define MID (l+r)>>1
#define LL __int64
template<class _T> inline _T loww(_T n){return n&(-n);}
template<class _T> inline void swapp(_T &x,_T &y){_T t;t=x,x=y,y=t;}
template<class _T> inline _T minn(_T i,_T j){return i>j?j:i;}
template<class _T> inline _T maxx(_T i,_T j){return i>j?i:j;}
template<class _T> inline _T gcd(_T b,_T c){return b&&c?(c?gcd(c,b%c):b):b|c;}
template<class _T> inline _T abss(_T b){return b>0?b:-b;}
const LL p=1000000007;
LL P(LL x,LL y)
{
	LL s=1;
	while(y)
	{
		if(y&1)
			s=s*x%p;
		x=x*x%p;
		y>>=1;
	}
	return s;
}
LL U(LL n)
{
	return P(n,p-2)%p;
}

const LL N=100005;
char c[N];
LL fact[N];
LL Ck1[N],Ck2[N],ten[N];
LL dp[N],dpp[N][2];
LL C(LL n,LL k){
	return fact[n]*U(fact[k]*fact[n-k]%p)%p;
}
int main(){
	LL n,k,i,s=0,b,sum=0;
	scanf("%I64d%I64d",&n,&k);
	scanf("%s",c);
	fact[0]=1;
	ten[0]=1;
	for(i=1;i<N;i++){
		fact[i]=fact[i-1]*i%p;
		ten[i]=ten[i-1]*10%p;
	}
	for(i=0;i<N;i++){
		if(k-1<0||i<k-1)Ck1[i]=0;
		else Ck1[i]=C(i,k-1);
		if(k-2<0||i<k-2)Ck2[i]=0;
		else Ck2[i]=C(i,k-2);
	}
	b=0;
	for(i=0;i<n-1;i++){
		b=(b*10+c[i]-'0')%p;
		s=(s+b*Ck1[n-2-i])%p;
	}
	b=(b*10+c[i]-'0')%p;
	if(k==0)
		s=(s+b)%p;
	b=0;
	for(i=n-1;i>0;i--){
		b=(b+(c[i]-'0')*ten[n-1-i])%p;
		s=(s+b*Ck1[i-1])%p;
	}
	for(i=1;i<n-1;i++)
		sum=(sum+c[i]-'0')%p;
	dp[1]=sum;dpp[1][0]=c[1]-'0';dpp[1][1]=c[n-2]-'0';
	for(i=2;i<=n-2;i++){
		dpp[i][0]=(dpp[i-1][0]*10+c[i]-'0')%p;
		dpp[i][1]=(dpp[i-1][1]+c[n-1-i]*ten[i-1]%p)%p;
		dp[i]=((dp[i-1]-dpp[i-1][1])*10+dp[i-1]-dpp[i-1][0])%p;
		if(dp[i]<0)dp[i]+=p;
	}
	for(i=1;i<=n-2;i++){
		s=(s+dp[i]*Ck2[n-2-i]%p)%p;
	}
	printf("%I64d\n",s);

}


#pragma comment(linker,"/STACK:102400000,102400000")
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<cstdio>
#include<queue>
#include<map>
#include<set>
#include<time.h>
#include<cstdlib>
#include<list>
#include<cstring>
#include<iterator>
#include<fstream>
#include<sstream>
using namespace std;
#define inf 1888888888
#define PI acos(-1.0)
#define FIR 1,n,1
#define LEFT l,mid,dq<<1
#define RIGHT mid+1,r,dq<<1|1
#define L (dq<<1)
#define R (dq<<1|1)
#define DQ l,r,dq
#define MID (l+r)>>1
#define LL __int64
template<class _T> inline _T loww(_T n){return n&(-n);}
template<class _T> inline void swapp(_T &x,_T &y){_T t;t=x,x=y,y=t;}
template<class _T> inline _T minn(_T i,_T j){return i>j?j:i;}
template<class _T> inline _T maxx(_T i,_T j){return i>j?i:j;}
template<class _T> inline _T gcd(_T b,_T c){return b&&c?(c?gcd(c,b%c):b):b|c;}
template<class _T> inline _T abss(_T b){return b>0?b:-b;}
const LL p=1000000007;
LL P(LL x,LL y)
{
	LL s=1;
	while(y)
	{
		if(y&1)
			s=s*x%p;
		x=x*x%p;
		y>>=1;
	}
	return s;
}
LL U(LL n)
{
	return P(n,p-2)%p;
}

const LL N=100005;
char c[N];
LL fact[N];
LL Ck1[N],Ck2[N],ten[N];
LL dp[N],dpp[N][2];
LL C(LL n,LL k){
	return fact[n]*U(fact[k]*fact[n-k]%p)%p;
}
int main(){
	LL n,k,i,s=0,b,sum=0;
	scanf("%I64d%I64d",&n,&k);
	scanf("%s",c);
	fact[0]=1;
	ten[0]=1;
	for(i=1;i<N;i++){
		fact[i]=fact[i-1]*i%p;
		ten[i]=ten[i-1]*10%p;
	}
	for(i=0;i<N;i++){
		if(k-1<0||i<k-1)Ck1[i]=0;
		else Ck1[i]=C(i,k-1);
		if(k-2<0||i<k-2)Ck2[i]=0;
		else Ck2[i]=C(i,k-2);
	}
	b=0;
	for(i=0;i<n-1;i++){
		b=(b*10+c[i]-'0')%p;
		s=(s+b*Ck1[n-2-i])%p;
	}
	b=(b*10+c[i]-'0')%p;
	if(k==0)
		s=(s+b)%p;
	b=0;
	for(i=n-1;i>0;i--){
		b=(b+(c[i]-'0')*ten[n-1-i])%p;
		s=(s+b*Ck1[i-1])%p;
	}
	for(i=1;i<n-1;i++)
		sum=(sum+c[i]-'0')%p;
	dp[1]=sum;dpp[1][0]=c[1]-'0';dpp[1][1]=c[n-2]-'0';
	for(i=2;i<=n-2;i++){
		dpp[i][0]=(dpp[i-1][0]*10+c[i]-'0')%p;
		dpp[i][1]=(dpp[i-1][1]+c[n-1-i]*ten[i-1]%p)%p;
		dp[i]=((dp[i-1]-dpp[i-1][1])*10+dp[i-1]-dpp[i-1][0])%p;
		if(dp[i]<0)dp[i]+=p;
	}
	for(i=1;i<=n-2;i++){
		s=(s+dp[i]*Ck2[n-2-i]%p)%p;
	}
	printf("%I64d\n",s);
	return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstdio>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <map>
#include <unordered_set>
using namespace std;

#define int64 long long
#define mp make_pair
const int64 inf = 2e9;
const int MOD = 1e9+7;

#ifdef _DEBUG
    const int N = 310;
#else
    const int N = 300010;
#endif

int n, k, d[N], c[N], p[N], f[N], vpref[N], vsuf[N], t[N];
string s;

int power(int b, int p)
{
    int res = 1;
    while (p)
    {
        if (p & 1) res = (1ll * res * b) % MOD;
        b = (1ll * b * b) % MOD;
        p /= 2;
    }
    return res;
}

int C(int n, int k)
{
    if (n < k) return 0;
    int r1 = power(f[k], MOD - 2);
    int r2 = power(f[n - k], MOD - 2);
    int res = f[n];
    res = (1ll * res * r1) % MOD;
    res = (1ll * res * r2) % MOD;
    return res;
}

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> n >> k;
    cin >> s;
    for (int i = 1; i <= n; i++) d[i] = s[i - 1] - '0';
    f[0] = 1;
    for (int i = 1; i <= n; i++) f[i] = (1ll * f[i - 1] * i) % MOD;
    t[0] = 1;
    for (int i = 1; i <= n; i++) t[i] = (1ll * t[i - 1] * 10) % MOD;
    int ans = 0;
    vpref[1] = d[1];
    for (int i = 2; i <= n; i++) vpref[i] = (1ll * vpref[i - 1] * 10 + d[i]) % MOD;
    vsuf[n] = d[n];
    for (int i = n - 1; i >= 1; i--) vsuf[i] = (1ll * t[n - i] * d[i] + vsuf[i + 1]) % MOD;
    if (k == 0)
    {
        ans = vpref[n];
    }
    else if (k == 1)
    {
        for (int i = 1; i < n; i++)
            ans = (1ll * ans + vpref[i] + vsuf[i + 1]) % MOD;
    }
    else
    {
        for (int i = 1; i < n - 1; i++) c[i] = C(n - i - 2, k - 2);
        p[n - 2] = c[n - 2];
        for (int i = n - 3; i >= 1; i--) p[i] = (p[i + 1] + c[i]) % MOD;
        for (int i = 1; i <= n - k; i++) ans = (1ll * ans + (1ll * vpref[i] * C(n - i - 1, k - 1)) % MOD) % MOD;
        for (int i = n; i >= k + 1; i--) ans = (1ll * ans + (1ll * vsuf[i] * C(i - 2, k - 1)) % MOD) % MOD;
        int val = 0, tmp = 0;
        int j = 1;
        for (int i = n - 1; i >= 2; i--)
        {
            val = (1ll * val + (1ll * t[j - 1] * p[j]) % MOD) % MOD;
            ans = (1ll * ans + 1ll * val * d[i]) % MOD;
            tmp = (1ll * tmp * 10) % MOD;
            tmp = (1ll * tmp + c[i - 1]) % MOD;
            val = (1ll * val + MOD - tmp) % MOD;
            j++;
        }
    }
    cout << ans;
    return 0;
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<ctime>
#include<cstdlib>
#include<math.h>
#include<queue>
#include<algorithm>
#include <fstream>
#include <map>
typedef long long ll;
using namespace std;
#define maxn 205
#define mod 1000000007
char s[maxn];
long long sum[maxn];
long long ssum[maxn];
long long sssum[maxn];
int n,k;
int exgcd(int a,int b,int &x,int &y){  //xa+yb=gcd(a,b)  可用于求逆元
    int d=a;
    if(b!=0){
        d=exgcd(b,a%b,y,x);
        y-=(a/b)*x;
    }
    else{
        x=1;y=0;
    }
    return d;
}
long long z[maxn];
int C(int u,int v){
    int x1,y1,x2,y2;
    exgcd((int)z[v], mod, x1, y1);
    exgcd((int)z[u-v], mod, x2, y2);
    return (int)(((z[u]*x1%mod)*x2)%mod);
}
void solve(){
    long long ans=0;
    long long Sum=0;
    for(int i=1;i<=n;i++){

        int v=k-2;
        int u=n-i-2;
        if(v<0) continue;
        if(u<v) continue;
        Sum=(Sum-ssum[n-i+1])*10+sum[i-1];
        Sum%=mod;
        int c=C(u,v);
        ans=(ans+c*Sum)%mod;
    }

    for(int i=1;i<=n;i++){
        int v=k-2;
        int u=n-i-2;
        if(v<0) continue;
        if(u<v) continue;
        long long tem=sssum[i-1]+ssum[n-i];
        int c=C(u,v);
        ans=(ans-c*tem)%mod;
    }

    for(int i=1;i<=n;i++){
        int v=k-1;
        int u=n-i-1;
        if(v<0) continue;
        if(u<v) continue;
        long long tem=sssum[i-1]+ssum[n-i];
        int c=C(u,v);
        ans=(ans+c*tem)%mod;
    }

    printf("%I64d\n",(ans+mod)%mod);
}

int main(){
    z[0]=1; for(int i=1;i<maxn;i++) z[i]=z[i-1]*i%mod;
    scanf("%d%d",&n,&k);
    scanf("%s",s);
    sum[n]=0;
    ssum[n]=0;
    sssum[0]=s[0]-'0';
    long long t=1;
    for(int i=n-1;i>=0;i--) sum[i]=sum[i+1]+s[i]-'0';
    for(int i=n-1;i>=0;i--){
        ssum[i]=(ssum[i+1]+t*(s[i]-'0'))%mod;
        t=(t*10)%mod;
    }
    for(int i=1;i<n;i++){
        sssum[i]=(sssum[i-1]*10+s[i]-'0')%mod;
    }
    solve();

}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<ctime>
#include<cstdlib>
#include<math.h>
#include<queue>
#include<algorithm>
#include <fstream>
#include <map>
typedef long long ll;
using namespace std;
#define maxn 200005
#define mod 1000000007
char s[maxn];
long long sum[maxn];
long long ssum[maxn];
long long sssum[maxn];
int n,k;
int exgcd(int a,int b,int &x,int &y){  //xa+yb=gcd(a,b)  可用于求逆元
    int d=a;
    if(b!=0){
        d=exgcd(b,a%b,y,x);
        y-=(a/b)*x;
    }
    else{
        x=1;y=0;
    }
    return d;
}
long long z[maxn];
int C(int u,int v){
    int x1,y1,x2,y2;
    exgcd((int)z[v], mod, x1, y1);
    exgcd((int)z[u-v], mod, x2, y2);
    return (int)(((z[u]*x1%mod)*x2)%mod);
}
void solve(){
    if(k==0)
    {
        printf("%I64d\n",ssum[0]);
        return ;
    }
    long long ans=0;
    long long Sum=0;
    for(int i=1;i<=n;i++){

        int v=k-2;
        int u=n-i-2;
        if(v<0) continue;
        if(u<v) continue;
        Sum=(Sum-ssum[n-i+1])*10+sum[i-1];
        Sum%=mod;
        int c=C(u,v);
        ans=(ans+c*Sum)%mod;
    }

    for(int i=1;i<=n;i++){
        int v=k-2;
        int u=n-i-2;
        if(v<0) continue;
        if(u<v) continue;
        long long tem=sssum[i-1]+ssum[n-i];
        int c=C(u,v);
        ans=(ans-c*tem)%mod;
    }

    for(int i=1;i<=n;i++){
        int v=k-1;
        int u=n-i-1;
        if(v<0) continue;
        if(u<v) continue;
        long long tem=sssum[i-1]+ssum[n-i];
        int c=C(u,v);
        ans=(ans+c*tem)%mod;
    }

    printf("%I64d\n",(ans+mod)%mod);
}

int main(){
    z[0]=1; for(int i=1;i<maxn;i++) z[i]=z[i-1]*i%mod;
    scanf("%d%d",&n,&k);
    scanf("%s",s);
    sum[n]=0;
    ssum[n]=0;
    sssum[0]=s[0]-'0';
    long long t=1;
    for(int i=n-1;i>=0;i--) sum[i]=sum[i+1]+s[i]-'0';
    for(int i=n-1;i>=0;i--){
        ssum[i]=(ssum[i+1]+t*(s[i]-'0'))%mod;
        t=(t*10)%mod;
    }
    for(int i=1;i<n;i++){
        sssum[i]=(sssum[i-1]*10+s[i]-'0')%mod;
    }
    solve();
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(ll i=0;i<x;i++)
#define rep1(i,x) for(ll i=1;i<=x;i++)
#define rrep(i,x) for(ll i=x-1;i>=0;i--)
#define rrep1(i,x) for(ll i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define min_3(a,b,c) min(a,min(b,c))
#define max_3(a,b,c) max(a,max(b,c))
#define mp1(a,b,c) P1(a,P(b,c))
#define pque(a) priority_queue<a>
#define rpque(a) priority_queue<a,vector<a>,greater<a>>

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};
const int kaijou[10]={1,1,2,6,24,120,720,5040,40320,362880};

const char a[4] = { 'A' , 'C' , 'G' , 'T' };
const ll M = 1000000007;

ll modpow(ll x,ll k){
	if(k == 0)return 1;
	ll ret = modpow(x,k/2);
	ret *= ret; ret %= M;
	if(k%2 == 1){ret *= x; ret %= M;}
	return ret;
}

ll dom(ll x){
	return modpow(x,M-2);
}

ll C(ll n,ll k,ll comb){
	if(n < k)return 0;
	if(n == k)return 1;
	comb *= n; comb %= M;
	comb *= dom(n-k); comb %= M;
	return comb;
}

int main(){
	ll n,k;
	string s;
	cin >> n >> k >> s;

	if(k == 0){
		ll ret = 0;
		rep(i,n){
			ll x = s[i]-48;
			ret += x * modpow(10,n-1-i);
			ret %= M;
			//cout << ret << endl;
		}
		cout << ret << endl;
		return 0;
	}

	ll ret = 0;
	ll sum = 0;
	ll comb = 0;
	rep(i,n-1){
		ll x = s[i]-48;
		sum += x;
		comb = C(i,k-1,comb);
		ll y = modpow(10,n-2-i);
		y *= sum; y %= M;
		y *= comb; y %= M;
		ret += y;
		ret %= M;
	}

	comb = 0;
	rep(i,n){
		ll x = s[i]-48;
		comb = C(i,k,comb);
		x *= comb; x %= M;
		x *= modpow(10,n-1-i); x %= M;
		ret += x;
		ret %= M;
	}

	cout << ret << endl;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
using namespace std;
#pragma comment(linker, "/STACK:256000000")
#define mp make_pair
#define pb push_back
#define all(C) (C).begin(), (C).end()
#define sz(C) (int)(C).size()
#define PRIME 1103
#define PRIME1 31415
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
//------------------------------------------------------------
int n, k;
int mod = 1e9 + 7;
int mas[100000];
int fac[100000];
int inv[100000];
int sum[100000];
int ex(int a, int v)
{
    int res = 1;
    while(v)
    {
        if (v & 1)
            res = (res * (int64) a) % mod;
        a = (a * (int64) a) % mod;
        v >>= 1;
    }
    return res;
}
int de[100000];
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> n >> k;
    string st;
    cin >> st;
    for(int i = 0; i < n; ++i)
        mas[i] = st[i] - '0';
    if (!k)
    {
        cout << st;
        return 0;
    }
    fac[0] = 1;
    inv[0] = 1;
    for(int i = 1; i <= n; ++i)
    {
        fac[i] = (fac[i - 1] * (int64) i) % mod;
        inv[i] = ex(fac[i], mod - 2);
    }
    sum[0] = mas[0];
    for(int i = 1; i < n; ++i)
        sum[i] = sum[i - 1] + mas[i];
    de[0] = 1;
    for(int i = 1; i < n; ++i)
        de[i] = (de[i - 1] * 10ll) % mod;
    int ans = 0;

    for(int i = 0; i < n - k; ++i)
    {
        int c = ((fac[n - 2 - i] *(int64) inv[k - 1]) % mod * inv[n - 1 - k - i]) % mod;
        ans += (((de[i] * (int64) sum[n - 2 - i]) % mod) * c) % mod;
        ans %= mod;
    }
    for(int i = k; i < n; ++i)
    {
        int c = ((fac[i] * (int64) inv[k]) % mod * inv[i - k]) % mod;
        ans += (((de[n - 1 - i] * (int64) mas[i]) % mod) * c) % mod;
        ans %= mod;
    }

    cout << ans;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
using namespace std;
#pragma comment(linker, "/STACK:256000000")
#define mp make_pair
#define pb push_back
#define all(C) (C).begin(), (C).end()
#define sz(C) (int)(C).size()
#define PRIME 1103
#define PRIME1 31415
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
//------------------------------------------------------------
int n, k;
int mod = 1e9 + 7;
int mas[100000];
int fac[100000];
int inv[100000];
int sum[100000];
int ex(int a, int v)
{
    int res = 1;
    while(v)
    {
        if (v & 1)
            res = (res * (int64) a) % mod;
        a = (a * (int64) a) % mod;
        v >>= 1;
    }
    return res;
}
int de[100000];
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> n >> k;
    string st;
    cin >> st;
    for(int i = 0; i < n; ++i)
        mas[i] = st[i] - '0';
    if (!k)
    {
        int ans = 0;
        for(int i = 0; i < n; ++i)
        {
            ans = (ans * 10ll) % mod;
            ans += mas[i];
            ans %= mod;
        }
        cout << ans;
        return 0;
    }
    fac[0] = 1;
    inv[0] = 1;
    for(int i = 1; i <= n; ++i)
    {
        fac[i] = (fac[i - 1] * (int64) i) % mod;
        inv[i] = ex(fac[i], mod - 2);
    }
    sum[0] = mas[0];
    for(int i = 1; i < n; ++i)
        sum[i] = sum[i - 1] + mas[i];
    de[0] = 1;
    for(int i = 1; i < n; ++i)
        de[i] = (de[i - 1] * 10ll) % mod;
    int ans = 0;

    for(int i = 0; i < n - k; ++i)
    {
        int c = ((fac[n - 2 - i] *(int64) inv[k - 1]) % mod * inv[n - 1 - k - i]) % mod;
        ans += (((de[i] * (int64) sum[n - 2 - i]) % mod) * c) % mod;
        ans %= mod;
    }
    for(int i = k; i < n; ++i)
    {
        int c = ((fac[i] * (int64) inv[k]) % mod * inv[i - k]) % mod;
        ans += (((de[n - 1 - i] * (int64) mas[i]) % mod) * c) % mod;
        ans %= mod;
    }

    cout << ans;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
using namespace std;
#pragma comment(linker, "/STACK:256000000")
#define mp make_pair
#define pb push_back
#define all(C) (C).begin(), (C).end()
#define sz(C) (int)(C).size()
#define PRIME 1103
#define PRIME1 31415
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
//------------------------------------------------------------
int64 n, k;
int64 mod = 1e9 + 7;
int64 mas[100000];
int64 fac[100000];
int64 inv[100000];
int64 sum[100000];
int ex(int a, int v)
{
    int res = 1;
    while(v)
    {
        if (v & 1)
            res = (res * (int64) a) % mod;
        a = (a * (int64) a) % mod;
        v >>= 1;
    }
    return res;
}
int64 de[100000];
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> n >> k;
    string st;
    cin >> st;
    for(int i = 0; i < n; ++i)
        mas[i] = st[i] - '0';
    if (!k)
    {
        int ans = 0;
        for(int i = 0; i < n; ++i)
        {
            ans = (ans * 10ll) % mod;
            ans += mas[i];
            ans %= mod;
        }
        cout << ans;
        return 0;
    }
    fac[0] = 1;
    inv[0] = 1;
    for(int i = 1; i <= n; ++i)
    {
        fac[i] = (fac[i - 1] * (int64) i) % mod;
        inv[i] = ex(fac[i], mod - 2);
    }
    sum[0] = mas[0];
    for(int i = 1; i < n; ++i)
        sum[i] = sum[i - 1] + mas[i];
    de[0] = 1;
    for(int i = 1; i < n; ++i)
        de[i] = (de[i - 1] * 10ll) % mod;
    int ans = 0;

    for(int i = 0; i < n - k; ++i)
    {
        int c = ((fac[n - 2 - i] *(int64) inv[k - 1]) % mod * inv[n - 1 - k - i]) % mod;
        ans += (((de[i] * (int64) sum[n - 2 - i]) % mod) * c) % mod;
        ans %= mod;
    }
    for(int i = k; i < n; ++i)
    {
        int c = ((fac[i] * (int64) inv[k]) % mod * inv[i - k]) % mod;
        ans += (((de[n - 1 - i] * (int64) mas[i]) % mod) * c) % mod;
        ans %= mod;
    }

    cout << ans;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
using namespace std;
#pragma comment(linker, "/STACK:256000000")
#define mp make_pair
#define pb push_back
#define all(C) (C).begin(), (C).end()
#define sz(C) (int)(C).size()
#define PRIME 1103
#define PRIME1 31415
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
//------------------------------------------------------------
int64 n, k;
int64 mod = 1e9 + 7;
int64 mas[100001];
int64 fac[100001];
int64 inv[100001];
int64 sum[100001];
int ex(int a, int v)
{
    int res = 1;
    while(v)
    {
        if (v & 1)
            res = (res * (int64) a) % mod;
        a = (a * (int64) a) % mod;
        v >>= 1;
    }
    return res;
}
int64 de[100000];
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> n >> k;
    string st;
    cin >> st;
    for(int i = 0; i < n; ++i)
        mas[i] = st[i] - '0';
    if (!k)
    {
        int ans = 0;
        for(int i = 0; i < n; ++i)
        {
            ans = (ans * 10ll) % mod;
            ans += mas[i];
            ans %= mod;
        }
        cout << ans;
        return 0;
    }
    fac[0] = 1;
    inv[0] = 1;
    for(int i = 1; i <= n; ++i)
    {
        fac[i] = (fac[i - 1] * (int64) i) % mod;
        inv[i] = ex(fac[i], mod - 2);
    }
    sum[0] = mas[0];
    for(int i = 1; i < n; ++i)
        sum[i] = sum[i - 1] + mas[i];
    de[0] = 1;
    for(int i = 1; i < n; ++i)
        de[i] = (de[i - 1] * 10ll) % mod;
    int ans = 0;

    for(int i = 0; i < n - k; ++i)
    {
        int c = ((fac[n - 2 - i] *(int64) inv[k - 1]) % mod * inv[n - 1 - k - i]) % mod;
        ans += (((de[i] * (int64) sum[n - 2 - i]) % mod) * c) % mod;
        ans %= mod;
    }
    for(int i = k; i < n; ++i)
    {
        int c = ((fac[i] * (int64) inv[k]) % mod * inv[i - k]) % mod;
        ans += (((de[n - 1 - i] * (int64) mas[i]) % mod) * c) % mod;
        ans %= mod;
    }

    cout << ans;
}


#include <iostream>
#include <string>
using namespace std;
#define MOD 1000000007LL
#define MOD 1000000007

long long nck[100005];
long long nck2[100005];
long long ten[100005];

long long inv(long long a,long long pw)
{
	if(pw==0LL) return 1LL;
	if(pw==1LL) return a;
	long long p = inv(a,pw/2LL);
	p = (p*p)%MOD;
	if(pw%2LL) return (a*p)%MOD;
	else return p;
}

int main()
{
	long long N,K;
	string s;
	cin >> N >> K >> s;
	long long nfst = K-1LL;
	long long kfst = K-1LL;
	nck[N-K-1] = 1LL;
	for(long long i=(N-K-2);i>=0;i--)
	{
		nfst++;
		nck[i] = (nfst*nck[i+1])%MOD;
		nck[i] = (nck[i]*inv(nfst-kfst,MOD-2LL))%MOD;
	}

	ten[0] = 1LL;
	for(long long i=1;i<N;i++)
		ten[i] = (ten[i-1]*10LL)%MOD;

	nck2[K] = 1LL;
	for(long long i=K+1;i<N;i++)
	{
		nck2[i] = (i*nck2[i-1])%MOD;
		nck2[i] = (nck2[i]*inv(i-K,MOD-2))%MOD;
	}
	long long ans = 0LL;
	long long psum = 0LL;
	for(long long i=(N-1);i>=0;i--)
	{
		if(i>=K)
			ans += (((long long)(s[i]-'0'))*((psum + (nck2[i]*ten[N-1-i])%MOD)%MOD))%MOD;
		else
			ans += (psum*((long long)(s[i]-'0')))%MOD;
		if(i>=K)
			psum = (psum + (nck[N-1-i]*ten[N-1-i])%MOD)%MOD;
		ans %= MOD;
	}
	ans %= MOD;
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
#define MOD 1000000007

int nck[100000];
int nck2[100000];
int ten[100000];

long long inv(long long a,long long pw)
{
	if(pw==0) return 1;
	if(pw==1) return a;
	long long p = inv(a,pw/2);
	p = (p*p)%MOD;
	if(pw%2) return (a*p)%MOD;
	else return p;
}

int main()
{
	int N,K;
	string s;
	cin >> N >> K >> s;
	int nfst = K-1;
	int kfst = K-1;
	nck[N-K-1] = 1;
	for(int i=(N-K-2);i>=0;i--)
	{
		nfst++;
		nck[i] = (nfst*nck[i+1])%MOD;
		nck[i] = (nck[i]*inv(nfst-kfst,MOD-2))%MOD;
	}

	ten[0] = 1;
	for(int i=1;i<N;i++)
		ten[i] = (ten[i-1]*10)%MOD;

	nck2[K] = 1;
	for(int i=K+1;i<N;i++)
	{
		nck2[i] = (i*nck2[i-1])%MOD;
		nck2[i] = (nck2[i]*inv(i-K,MOD-2))%MOD;
	}
	long long ans = 0;
	int iCur = -1;
	long long psum = 0;
	for(int i=(N-1);i>=0;i--)
	{
		ans += ((s[i]-'0')*(psum + (nck2[i]*ten[N-1-i])%MOD))%MOD;
		if(i>=K)
			psum = (psum + (nck[N-1-i]*ten[N-1-i])%MOD)%MOD;
	}
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
#define MOD 1000000007LL

long long nck[100005];
long long nck2[100005];
long long ten[100005];

long long inv(long long a,long long pw)
{
	if(pw==0) return 1;
	if(pw==1) return a;
	long long p = inv(a,pw/2);
	p = (p*p)%MOD;
	if(pw%2) return (a*p)%MOD;
	else return p;
}

int main()
{
	long long N,K;
	string s;
	cin >> N >> K >> s;
	if(K==0)
	{
		cout << s << endl;
		return 0;
	}
	long long nfst = K-1;
	long long kfst = K-1;
	nck[N-K-1] = 1;
	for(long long i=(N-K-2);i>=0;i--)
	{
		nfst++;
		nck[i] = (nfst*nck[i+1])%MOD;
		nck[i] = (nck[i]*inv(nfst-kfst,MOD-2))%MOD;
	}

	ten[0] = 1LL;
	for(long long i=1;i<N;i++)
		ten[i] = (ten[i-1]*10LL)%MOD;

	nck2[K] = 1LL;
	for(long long i=K+1;i<N;i++)
	{
		nck2[i] = (i*nck2[i-1])%MOD;
		nck2[i] = (nck2[i]*inv(i-K,MOD-2))%MOD;
	}
	long long ans = 0LL;
	long long psum = 0LL;
	for(long long i=(N-1);i>=0;i--)
	{
		if(i>=K)
			ans += (((long long)(s[i]-'0'))*((psum + (nck2[i]*ten[N-1-i])%MOD)%MOD))%MOD;
		else
			ans += (psum*((long long)(s[i]-'0')))%MOD;
		if(i>=K)
			psum = (psum + (nck[N-1-i]*ten[N-1-i])%MOD)%MOD;
	}
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
#define MOD 1000000007LL

long long nck[100000];
long long nck2[100000];
long long ten[100000];

long long inv(long long a,long long pw)
{
	if(pw==0) return 1;
	if(pw==1) return a;
	long long p = inv(a,pw/2);
	p = (p*p)%MOD;
	if(pw%2) return (a*p)%MOD;
	else return p;
}

int main()
{
	long long N,K;
	string s;
	cin >> N >> K >> s;
	long long nfst = K-1;
	long long kfst = K-1;
	nck[N-K-1] = 1;
	for(long long i=(N-K-2);i>=0;i--)
	{
		nfst++;
		nck[i] = (nfst*nck[i+1])%MOD;
		nck[i] = (nck[i]*inv(nfst-kfst,MOD-2))%MOD;
	}

	ten[0] = 1LL;
	for(long long i=1;i<N;i++)
		ten[i] = (ten[i-1]*10LL)%MOD;

	nck2[K] = 1LL;
	for(long long i=K+1;i<N;i++)
	{
		nck2[i] = (i*nck2[i-1])%MOD;
		nck2[i] = (nck2[i]*inv(i-K,MOD-2))%MOD;
	}
	long long ans = 0;
	long long psum = 0;
	for(long long i=(N-1);i>=0;i--)
	{
		if(i>=K)
			ans += (((long long)(s[i]-'0'))*((psum + (nck2[i]*ten[N-1-i])%MOD)%MOD))%MOD;
		else
			ans += (((long long)(s[i]-'0'))*psum)%MOD;
		if(i>=K)
			psum = (psum + (nck[N-1-i]*ten[N-1-i])%MOD)%MOD;
	}
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
#define MOD 1000000007

int nck[100000];
int nck2[100000];
int ten[100000];

long long inv(long long a,long long pw)
{
	if(pw==0) return 1;
	if(pw==1) return a;
	long long p = inv(a,pw/2);
	p = (p*p)%MOD;
	if(pw%2) return (a*p)%MOD;
	else return p;
}

int main()
{
	int N,K;
	string s;
	cin >> N >> K >> s;
	int nfst = K-1;
	int kfst = K-1;
	nck[N-K-1] = 1;
	for(int i=(N-K-2);i>=0;i--)
	{
		nfst++;
		nck[i] = (nfst*nck[i+1])%MOD;
		nck[i] = (nck[i]*inv(nfst-kfst,MOD-2))%MOD;
	}

	ten[0] = 1LL;
	for(int i=1;i<N;i++)
		ten[i] = (ten[i-1]*10LL)%MOD;

	nck2[K] = 1;
	for(int i=K+1;i<N;i++)
	{
		nck2[i] = (i*nck2[i-1])%MOD;
		nck2[i] = (nck2[i]*inv(i-K,MOD-2))%MOD;
	}
	long long ans = 0;
	int iCur = -1;
	long long psum = 0;
	for(int i=(N-1);i>=0;i--)
	{
		if(i>=K)
			ans += ((s[i]-'0')*((psum + (nck2[i]*ten[N-1-i])%MOD)%MOD))%MOD;
		else
			ans += ((s[i]-'0')*psum)%MOD;
		if(i>=K)
			psum = (psum + (nck[N-1-i]*ten[N-1-i])%MOD)%MOD;
	}
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
#define MOD 1000000007LL

long long nck[100000];
long long nck2[100000];
long long ten[100000];

long long inv(long long a,long long pw)
{
	if(pw==0) return 1;
	if(pw==1) return a;
	long long p = inv(a,pw/2);
	p = (p*p)%MOD;
	if(pw%2) return (a*p)%MOD;
	else return p;
}

int main()
{
	long long N,K;
	string s;
	cin >> N >> K >> s;
	if(K==0)
	{
		cout << s << endl;
		return 0;
	}
	long long nfst = K-1;
	long long kfst = K-1;
	nck[N-K-1] = 1;
	for(long long i=(N-K-2);i>=0;i--)
	{
		nfst++;
		nck[i] = (nfst*nck[i+1])%MOD;
		nck[i] = (nck[i]*inv(nfst-kfst,MOD-2))%MOD;
	}

	ten[0] = 1LL;
	for(long long i=1;i<N;i++)
		ten[i] = (ten[i-1]*10LL)%MOD;

	nck2[K] = 1LL;
	for(long long i=K+1;i<N;i++)
	{
		nck2[i] = (i*nck2[i-1])%MOD;
		nck2[i] = (nck2[i]*inv(i-K,MOD-2))%MOD;
	}
	long long ans = 0;
	long long psum = 0;
	for(long long i=(N-1);i>=0;i--)
	{
		if(i>=K)
			ans += (((long long)(s[i]-'0'))*((psum + (nck2[i]*ten[N-1-i])%MOD)%MOD))%MOD;
		else
			ans += (psum*((long long)(s[i]-'0')))%MOD;
		if(i>=K)
			psum = (psum + (nck[N-1-i]*ten[N-1-i])%MOD)%MOD;
	}
	cout << ans << endl;
	return 0;
}


//written by mhadih
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;

const ll N = 2e5;
const ll INF = 1e15;
const ll MOD = 1000000007;

ll n,k,a[N],p[N],p1[N],fact[N];
string s;

ll POW(ll a,ll b)
{
	if (b==1) return a;
	ll ans = POW(a,b/2);
	if (b%2==0)
		return ans*ans%MOD;
	else
		return ans*ans%MOD*a%MOD;
}

ll C(ll a,ll b)
{
	return fact[b]*POW(fact[a],MOD-2)%MOD*POW(fact[b-a],MOD-2)%MOD;
}

int main()
{
    ios::sync_with_stdio(false);
    ifstream inf("input.txt");
	cin >> n >> k;
	cin >> s;
	a[0] = 1;
	fact[0] = 1;
	fact[1] = 1;
	for (int i = 2; i<=1e5; i++)
		fact[i] = fact[i-1]*i%MOD;
	//cout << C(5,1e5) << ' ';
	for (int i = 1; i<=n; i++)
		a[i] = a[i-1]*10%MOD;
	for (int i = 0; i<n; i++)
	{
		if (i==0) p[i] = 0;
		else p[i] = (p[i-1]+s[i]-'0')%MOD;
	}
	p1[1] = s[1]-'0';
	for (int i = 2; i<n; i++)
		p1[i] = (p1[i-1]*10+s[i]-'0')%MOD;
	ll sum = 0 , ans = 0;
	if (k>1)
	for (int i = 0; i<n-2; i++)
	{
		if (n-i-3<k-2) break;
		sum = (sum+(p[n-i-2]-p[0])*a[i])%MOD;
		sum = (sum-p1[i]*a[i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-2,n-i-3))%MOD;
	}
	sum = 0;
	if (k>0)
	for (int i = 0; i<n; i++)
	{
		if (n-i-2<k-1) break;
		sum = (sum*10+s[i]-'0')%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,n-i-2))%MOD;
		//cout << ans << endl;
	}
	if (k==0)
	{
		sum = 0;
		for (int i = 0; i<n; i++)
			sum = (sum*10+s[i]-'0')%MOD;
		cout << sum;
		return 0;
	}
	sum = 0;
	if (k>0)
	for (int i = n-1; i>0; i--)
	{
		if (i-1<k-1) break;
		sum = (sum+(s[i]-'0')*a[n-i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,i-1))%MOD;
		//cout << ans << endl;
	}
	cout << ans;
}


//written by mhadih
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;

const ll N = 2e5;
const ll INF = 1e15;
const ll MOD = 1000000007;

ll n,k,a[N],p[N],p1[N],fact[N];
string s;

ll POW(ll a,ll b)
{
	if (b==1) return a;
	ll ans = POW(a,b/2);
	if (b%2==0)
		return ans*ans%MOD;
	else
		return ans*ans%MOD*a%MOD;
}

ll C(ll a,ll b)
{
	return fact[b]*POW(fact[a],MOD-2)%MOD*POW(fact[b-a],MOD-2)%MOD;
}

int main()
{
    ios::sync_with_stdio(false);
    ifstream inf("input.txt");
	cin >> n >> k;
	cin >> s;
	a[0] = 1;
	fact[0] = 1;
	fact[1] = 1;
	for (int i = 2; i<=n; i++)
		fact[i] = fact[i-1]*i%MOD;
	for (int i = 1; i<=n; i++)
		a[i] = a[i-1]*10%MOD;
	for (int i = 0; i<n; i++)
	{
		if (i==0) p[i] = 0;
		else p[i] = (p[i-1]+s[i]-'0')%MOD;
	}
	p1[1] = s[1]-'0';
	for (int i = 2; i<n; i++)
		p1[i] = (p1[i-1]*10+s[i]-'0')%MOD;
	ll sum = 0 , ans = 0;
	for (int i = 0; i<n-2; i++)
	{
		if (n-i-3<k-2) break;
		sum = (sum+(p[n-i-2]-p[0])*a[i])%MOD;
		sum = (sum-p1[i]*a[i-1])%MOD;
		//cout << sum << ' ';
		ans = ans+sum*C(k-2,n-i-3);
	}
	sum = 0;
	for (int i = 0; i<n; i++)
	{
		if (n-i-2<k-1) break;
		sum = (sum*10+s[i]-'0')%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,n-i-2))%MOD;
		//cout << ans << endl;
	}
	sum = 0;
	for (int i = n-1; i>0; i--)
	{
		if (i-1<k-1) break;
		sum = (sum+(s[i]-'0')*a[n-i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,i-1))%MOD;
		//cout << ans << endl;
	}
	cout << ans;
}


//written by mhadih
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;

const ll N = 2e5;
const ll INF = 1e15;
const ll MOD = 1000000007;

ll n,k,a[N],p[N],p1[N],fact[N];
string s;

ll POW(ll a,ll b)
{
	if (b==1) return a;
	ll ans = POW(a,b/2);
	if (b%2==0)
		return ans*ans%MOD;
	else
		return ans*ans%MOD*a%MOD;
}

ll C(ll a,ll b)
{
	return fact[b]*POW(fact[a],MOD-2)%MOD*POW(fact[b-a],MOD-2)%MOD;
}

int main()
{
    ios::sync_with_stdio(false);
    ifstream inf("input.txt");
	cin >> n >> k;
	cin >> s;
	a[0] = 1;
	fact[0] = 1;
	fact[1] = 1;
	for (int i = 2; i<=n; i++)
		fact[i] = fact[i-1]*i%MOD;
	for (int i = 1; i<=n; i++)
		a[i] = a[i-1]*10%MOD;
	for (int i = 0; i<n; i++)
	{
		if (i==0) p[i] = 0;
		else p[i] = (p[i-1]+s[i]-'0')%MOD;
	}
	p1[1] = s[1]-'0';
	for (int i = 2; i<n; i++)
		p1[i] = (p1[i-1]*10+s[i]-'0')%MOD;
	ll sum = 0 , ans = 0;
	for (int i = 0; i<n-2; i++)
	{
		if (n-i-3<k-2) break;
		sum = (sum+(p[n-i-2]-p[0])*a[i])%MOD;
		sum = (sum-p1[i]*a[i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-2,n-i-3))%MOD;
	}
	sum = 0;
	for (int i = 0; i<n; i++)
	{
		if (n-i-2<k-1) break;
		sum = (sum*10+s[i]-'0')%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,n-i-2))%MOD;
		//cout << ans << endl;
	}
	sum = 0;
	for (int i = n-1; i>0; i--)
	{
		if (i-1<k-1) break;
		sum = (sum+(s[i]-'0')*a[n-i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,i-1))%MOD;
		//cout << ans << endl;
	}
	cout << ans;
}


//written by mhadih
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;

const ll N = 2e5;
const ll INF = 1e15;
const ll MOD = 1000000007;

ll n,k,a[N],p[N],p1[N],fact[N];
string s;

ll POW(ll a,ll b)
{
	if (b==1) return a;
	ll ans = POW(a,b/2);
	if (b%2==0)
		return ans*ans%MOD;
	else
		return ans*ans%MOD*a%MOD;
}

ll C(ll a,ll b)
{
	return fact[b]*POW(fact[a],MOD-2)%MOD*POW(fact[b-a],MOD-2)%MOD;
}

int main()
{
    ios::sync_with_stdio(false);
    ifstream inf("input.txt");
	cin >> n >> k;
	cin >> s;
	a[0] = 1;
	fact[0] = 1;
	fact[1] = 1;
	for (int i = 2; i<=1e5; i++)
		fact[i] = fact[i-1]*i%MOD;
	//cout << C(5,1e5) << ' ';
	for (int i = 1; i<=n; i++)
		a[i] = a[i-1]*10%MOD;
	for (int i = 0; i<n; i++)
	{
		if (i==0) p[i] = 0;
		else p[i] = (p[i-1]+s[i]-'0')%MOD;
	}
	p1[1] = s[1]-'0';
	for (int i = 2; i<n; i++)
		p1[i] = (p1[i-1]*10+s[i]-'0')%MOD;
	ll sum = 0 , ans = 0;
	if (k>1)
	for (int i = 0; i<n-2; i++)
	{
		if (n-i-3<k-2) break;
		sum = (sum+(p[n-i-2]-p[0])*a[i])%MOD;
		if (i!=0) sum = (sum-p1[i]*a[i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-2,n-i-3))%MOD;
	}
	sum = 0;
	if (k>0)
	for (int i = 0; i<n; i++)
	{
		if (n-i-2<k-1) break;
		sum = (sum*10+s[i]-'0')%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,n-i-2))%MOD;
		//cout << ans << endl;
	}
	if (k==0)
	{
		sum = 0;
		for (int i = 0; i<n; i++)
			sum = (sum*10+s[i]-'0')%MOD;
		cout << sum;
		return 0;
	}
	sum = 0;
	if (k>0)
	for (int i = n-1; i>0; i--)
	{
		if (i-1<k-1) break;
		sum = (sum+(s[i]-'0')*a[n-i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,i-1))%MOD;
		//cout << ans << endl;
	}
	cout << ans;
}


//written by mhadih
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;

const ll N = 2e5;
const ll INF = 1e15;
const ll MOD = 1000000007;

ll n,k,a[N],p[N],p1[N],fact[N];
string s;

ll POW(ll a,ll b)
{
	if (b==1) return a;
	ll ans = POW(a,b/2);
	if (b%2==0)
		return ans*ans%MOD;
	else
		return ans*ans%MOD*a%MOD;
}

ll C(ll a,ll b)
{
	return fact[b]*POW(fact[a],MOD-2)%MOD*POW(fact[b-a],MOD-2)%MOD;
}

int main()
{
    ios::sync_with_stdio(false);
    ifstream inf("input.txt");
	cin >> n >> k;
	cin >> s;
	a[0] = 1;
	fact[0] = 1;
	fact[1] = 1;
	for (int i = 2; i<=1e5; i++)
		fact[i] = fact[i-1]*i%MOD;
	//cout << C(5,1e5) << ' ';
	for (int i = 1; i<=n; i++)
		a[i] = a[i-1]*10%MOD;
	for (int i = 0; i<n; i++)
	{
		if (i==0) p[i] = 0;
		else p[i] = (p[i-1]+s[i]-'0')%MOD;
	}
	if (n>1) p1[1] = s[1]-'0';
	for (int i = 2; i<n; i++)
		p1[i] = (p1[i-1]*10+s[i]-'0')%MOD;
	ll sum = 0 , ans = 0;
	if (k>1)
	for (int i = 0; i<n-2; i++)
	{
		if (n-i-3<k-2) break;
		sum = (sum+(p[n-i-2]-p[0])*a[i])%MOD;
		if (i!=0) sum = (sum-p1[i]*a[i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-2,n-i-3))%MOD;
	}
	sum = 0;
	if (k>0)
	for (int i = 0; i<n; i++)
	{
		if (n-i-2<k-1) break;
		sum = (sum*10+s[i]-'0')%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,n-i-2))%MOD;
		//cout << ans << endl;
	}
	if (k==0)
	{
		sum = 0;
		for (int i = 0; i<n; i++)
			sum = (sum*10+s[i]-'0')%MOD;
		cout << sum;
		return 0;
	}
	sum = 0;
	if (k>0)
	for (int i = n-1; i>0; i--)
	{
		if (i-1<k-1) break;
		sum = (sum+(s[i]-'0')*a[n-i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,i-1))%MOD;
		//cout << ans << endl;
	}
	cout << ans;
}


//written by mhadih
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>

using namespace std;

//#define cin inf
//#define cout of

typedef long long ll;

const ll N = 2e5;
const ll INF = 1e15;
const ll MOD = 1000000007;

ll n,k,a[N],p[N],p1[N],fact[N];
string s;

ll POW(ll a,ll b)
{
	if (b==1) return a;
	ll ans = POW(a,b/2);
	if (b%2==0)
		return ans*ans%MOD;
	else
		return ans*ans%MOD*a%MOD;
}

ll C(ll a,ll b)
{
	return fact[b]*POW(fact[a],MOD-2)%MOD*POW(fact[b-a],MOD-2)%MOD;
}

int main()
{
    ios::sync_with_stdio(false);
    ifstream inf("input.txt");
	cin >> n >> k;
	cin >> s;
	a[0] = 1;
	fact[0] = 1;
	fact[1] = 1;
	for (int i = 2; i<=1e5; i++)
		fact[i] = fact[i-1]*i%MOD;
	//cout << C(5,1e5) << ' ';
	for (int i = 1; i<=n; i++)
		a[i] = a[i-1]*10%MOD;
	for (int i = 0; i<n; i++)
	{
		if (i==0) p[i] = 0;
		else p[i] = (p[i-1]+s[i]-'0')%MOD;
	}
	if (n>1) p1[1] = s[1]-'0';
	for (int i = 2; i<n; i++)
		p1[i] = (p1[i-1]*10+s[i]-'0')%MOD;
	ll sum = 0 , ans = 0;
	if (k>1)
	for (int i = 0; i<n-2; i++)
	{
		if (n-i-3<k-2) break;
		sum = (sum+(p[n-i-2]-p[0])*a[i])%MOD;
		if (i!=0) sum = (sum-p1[i])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-2,n-i-3))%MOD;
		//cout << ans << endl;
	}
	sum = 0;
	if (k>0)
	for (int i = 0; i<n; i++)
	{
		if (n-i-2<k-1) break;
		sum = (sum*10+s[i]-'0')%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,n-i-2))%MOD;
		//cout << ans << endl;
	}
	if (k==0)
	{
		sum = 0;
		for (int i = 0; i<n; i++)
			sum = (sum*10+s[i]-'0')%MOD;
		cout << sum;
		return 0;
	}
	sum = 0;
	if (k>0)
	for (int i = n-1; i>0; i--)
	{
		if (i-1<k-1) break;
		sum = (sum+(s[i]-'0')*a[n-i-1])%MOD;
		//cout << sum << ' ';
		ans = (ans+sum*C(k-1,i-1))%MOD;
		//cout << ans << endl;
	}
	cout << ans;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
using namespace std;
char str[100005];
__int64 dp[100005],sum[100005],shi[100005],ans;
const int maxn=100005;
__int64 factorial[2*maxn],mod=1e9+7;
void init(){
    factorial[0] = 1;
    for(int i = 1;i< 2*maxn;i++){
        factorial[i] = (factorial[i-1]*i)%mod;
    }
}
__int64 powmod(__int64 a, __int64 m, __int64 n){
    __int64 ret = 1;
    a %= n;
    while(m){
        if(m&1) ret=ret*a%n;a=a*a%n;m>>=1;
    }
    return ret;
}
__int64 calCmn(__int64 p, __int64 q){
    if(q==1) return p;
    __int64 x=q, y=p-q;
    __int64 tmp=(factorial[p]%mod) * powmod(factorial[y]*factorial[x], mod-2, mod)%mod;
    return tmp;
}
int main(){
    int i,j,k,n,m,vt;
    scanf("%d%d%s",&n,&k,str+1);
    init();
    shi[1]=1;
    for(i=1;i<=n;i++){
        if(n-i-1<k-1) break;
        dp[i]=shi[i]*calCmn(n-i-1,k-1);
        dp[i]%=mod;
        sum[i]=sum[i-1]+dp[i];
        sum[i]%=mod;
        shi[i+1]=shi[i]*10;
        shi[i+1]%=mod;
    }
    for(i=1;i<=n;i++){
        vt=min(n-k,n-i+1);
        if(vt==n-i+1){
            if(vt>1) ans+=sum[vt-1]*(str[i]-'0');
            ans+=calCmn(i-1,k)*(str[i]-'0')%mod*shi[vt];
        }
        else ans+=sum[vt]*(str[i]-'0');
        ans%=mod;
    }
    printf("%I64d\n",ans);
    //system("pause");
    return 0;
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <string>
#include <utility>
#include <cstdio>
#include <set>
#include <map>
#include <numeric>
//#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)

using namespace std;
using ll = long long int;
template <typename T>
vector<size_t> sort_indexes(const vector<T> &v) {

	// initialize original index locations
	vector<size_t> idx(v.size());
	for (size_t i = 0; i != idx.size(); ++i) idx[i] = i;

	// sort indexes based on comparing values in v
	sort(idx.begin(), idx.end(),
		[&v](size_t i1, size_t i2) {return v[i1] < v[i2]; });

	return idx;
}
int gcd(int n1, int n2) {
	return (n2 == 0) ? n1 : gcd(n2, n1 % n2);
}
int cnt_ones(int i)
{
	i = i - ((i >> 1) & 0x55555555);
	i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
	return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}
string DecToBin(int number)
{
	if (number == 0) return "0";
	if (number == 1) return "1";

	if (number % 2 == 0)
		return DecToBin(number / 2) + "0";
	else
		return DecToBin(number / 2) + "1";
}
long long int fact(int a)
{
	// 	printf("in factorial");
	long long	int p = 1;
	while (a >= 1)
	{
		p = p*a;
		a--;
	}

	return p;
}
long long int combination(int a, int b)
{
	//	printf("in combination");
	return(fact(a) / (fact(b)*fact(a - b)));
}
unsigned nChoosek(unsigned n, unsigned k)
{
	if (k > n) return 0;
	if (k * 2 > n) k = n - k;
	if (k == 0) return 1;

	int result = n;
	for (unsigned i = 2; i <= k; ++i) {
		result *= (n - i + 1);
		result /= i;
	}
	return result;
}
std::uint64_t cnr(int n, int r)
{
	std::uint64_t ans = 1;
	r = std::min(r, n - r);

	for (int j = 1; j <= r; j++, n--) {
		// all following do: ans = (ans * n) / j;
		// but the 2 first cases do some simplifications
		// to reduce the possibility of overflow

		if (n % j == 0) {
			ans *= n / j;
		}
		else if (ans % j == 0) {
			ans = (ans / j) * n;
		}
		else {
			ans = (ans * n) / j;
		}
	}
	return ans;
}
long long C(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}
template<class T>
inline bool read(T &n)
{
	T x = 0, tmp = 1;
	char c = getchar();
	while ((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();
	if (c == EOF) return false;
	if (c == '-') c = getchar(), tmp = -1;
	while (c >= '0' && c <= '9') x *= 10, x += (c - '0'), c = getchar();
	n = x*tmp;
	return true;
}
template <class T>
inline void write(T n)
{
	if (n < 0)
	{
		putchar('-');
		n = -n;
	}
	int len = 0, data[20];
	while (n)
	{
		data[len++] = n % 10;
		n /= 10;
	}
	if (!len) data[len++] = 0;
	while (len--) putchar(data[len] + 48);
}
// generatore di 'lucky numbers' fino a 10e9
vector<ll> lucky;
#define MAX 100000000000ll
void make(ll num) {
	if (MAX < num) return;
	lucky.push_back(num);
	make(num * 10 + 4);
	make(num * 10 + 7);
}
// generatore di primi
bool prime[1000000]{ 1,1 };
void sieve() {
	for (int i = 2; i * i <= 1000000; i++)
		if (!prime[i]) {
			for (int j = i * i; j <= 1000000; j += i) prime[j] = 1;
		}
}
////////////////////////////////////////////////////////////////
typedef unsigned long long ull;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)(c).size())
#define ten(x) ((int)1e##x)

#pragma comment(linker,"/STACK:36777216")

template<class T> void chmax(T& l, const T r) { l = max(l, r); }
template<class T> void chmin(T& l, const T r) { l = min(l, r); }

#ifdef _WIN32
#   define mygc(c) (c)=getchar()
#   define mypc(c) putchar(c)
#else
#   define mygc(c) (c)=getchar_unlocked()
#   define mypc(c) putchar_unlocked(c)
#endif

void reader(int& x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; }if ('0' <= k&&k <= '9') { x = k - '0'; break; } }for (;;) { mygc(k); if (k<'0' || k>'9')break; x = x * 10 + k - '0'; }if (m) x = -x; }
void reader(ll& x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; }if ('0' <= k&&k <= '9') { x = k - '0'; break; } }for (;;) { mygc(k); if (k<'0' || k>'9')break; x = x * 10 + k - '0'; }if (m) x = -x; }
int reader(char c[]) { int i, s = 0; for (;;) { mygc(i); if (i != ' '&&i != '\n'&&i != '\r'&&i != '\t'&&i != EOF) break; }c[s++] = i; for (;;) { mygc(i); if (i == ' ' || i == '\n' || i == '\r' || i == '\t' || i == EOF) break; c[s++] = i; }c[s] = '\0'; return s; }
template <class T, class S> void reader(T& x, S& y) { reader(x); reader(y); }
template <class T, class S, class U> void reader(T& x, S& y, U& z) { reader(x); reader(y); reader(z); }
template <class T, class S, class U, class V> void reader(T& x, S& y, U& z, V & w) { reader(x); reader(y); reader(z); reader(w); }

void writer(int x, char c) { int s = 0, m = 0; char f[10]; if (x < 0)m = 1, x = -x; while (x)f[s++] = x % 10, x /= 10; if (!s)f[s++] = 0; if (m)mypc('-'); while (s--)mypc(f[s] + '0'); mypc(c); }
void writer(ll x, char c) { int s = 0, m = 0; char f[20]; if (x < 0)m = 1, x = -x; while (x)f[s++] = x % 10, x /= 10; if (!s)f[s++] = 0; if (m)mypc('-'); while (s--)mypc(f[s] + '0'); mypc(c); }
void writer(const char c[]) { int i; for (i = 0; c[i] != '\0'; i++)mypc(c[i]); }
void writer(const char x[], char c) { int i; for (i = 0; x[i] != '\0'; i++)mypc(x[i]); mypc(c); }
template<class T> void writerLn(T x) { writer(x, '\n'); }
template<class T, class S> void writerLn(T x, S y) { writer(x, ' '); writer(y, '\n'); }
template<class T, class S, class U> void writerLn(T x, S y, U z) { writer(x, ' '); writer(y, ' '); writer(z, '\n'); }
template<class T> void writerArr(T x[], int n) { if (!n) { mypc('\n'); return; }FOR(i, n - 1)writer(x[i], ' '); writer(x[n - 1], '\n'); }

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<class T> T extgcd(T a, T b, T& x, T& y) { for (T u = y = 1, v = x = 0; a;) { T q = b / a; swap(x -= q * u, u); swap(y -= q * v, v); swap(b -= q * a, a); } return b; }
template<class T> T mod_inv(T a, T m) { T x, y; extgcd(a, m, x, y); return (m + x % m) % m; }
template<class T> T CRT(T r1, T m1, T r2, T m2) { T a1, a2; extgcd(m1, m2, a1, a2); T ret = (m1*a1*r2 + m2*a2*r1) % (m1*m2); return ret < 0 ? ret + m1 * m2 : ret; }

///////////////////////////////////////////////////////////////
int main()
{
	//freopen("C:/input.txt", "r", stdin);
	//freopen("C:/output.txt","w",stdout);
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	int m, n, ans = 0;
	cin >> m;
	vector<int>q(m);
	for (auto & i : q)
		cin >> i;
	cin >> n;
	vector<int>a(n);
	for (auto &i : a)
		cin >> i;
	sort(q.rbegin(), q.rend());
	sort(a.begin(), a.end());
	for (int i = 2, j = 0; j < m && i < n; i += 3)
	{
		ans += a[i] * q[j];
	}
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	int m, n, ans = 0;
	cin >> m;
	vector<int>q(m);
	for (auto & i : q)
		cin >> i;
	cin >> n;
	vector<int>a(n);
	for (auto &i : a)
		cin >> i;
	sort(q.rbegin(), q.rend());
	sort(a.rbegin(), a.rend());
	for (int i = 0, ctr = q[0]; i < n; )
	{
		if (ctr)
		{
			ans += a[i];
			ctr--;
			i++;
		}
		else
		{
			if (i + q[0] < n - 1)
				i += q[0];
			else
				break;
			ctr = q[0];
		}
	}
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	int m, n, ans = 0;
	cin >> m;
	vector<int>q(m);
	for (auto & i : q)
		cin >> i;
	cin >> n;
	vector<int>a(n);
	for (auto &i : a)
		cin >> i;
	sort(q.rbegin(), q.rend());
	sort(a.begin(), a.end());
	int k, j;
	for (k = 2, j = 0; j < m && k < n; k += 3)
	{
		ans += a[k] * q[j];
	}
	for (int i = n - 1; i >= k - 3; i -= 2)
	{
		ans += a[i];
	}
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	int m, n, ans = 0;
	cin >> m;
	vector<int>q(m);
	for (auto & i : q)
		cin >> i;
	cin >> n;
	vector<int>a(n);
	for (auto &i : a)
		cin >> i;
	sort(q.begin(), q.end());
	sort(a.rbegin(), a.rend());
	for (int i = 0, ctr = q[0]; i < n; )
	{
		if (ctr)
		{
			ans += a[i];
			ctr--;
			i++;
		}
		else
		{
			if (i + 2 < n)
				i += 2;
			else
				break;
			ctr = q[0];
		}
	}
	cout << ans << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	int m, n, ans = 0;
	cin >> m;
	vector<int>q(m);
	for (auto & i : q)
		cin >> i;
	cin >> n;
	vector<int>a(n);
	for (auto &i : a)
		cin >> i;
	sort(q.rbegin(), q.rend());
	sort(a.rbegin(), a.rend());
	for (int i = 0, ctr = q[0]; i < n; )
	{
		if (ctr)
		{
			ans += a[i];
			ctr--;
			i++;
		}
		else
		{
			if (i + 2 < n - 1)
				i += 2;
			else
				break;
			ctr = q[0];
		}
	}
	cout << ans << "\n";
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
const int maxn=1000100;
const int INF=1e9+10;

int m,n;
int q[maxn],a[maxn];

int main()
{
    //freopen("in.txt","r",stdin);
    while(cin>>m){
        for(int i=1;i<=m;i++) scanf("%d",&q[i]);
        sort(q+1,q+m+1);
        cin>>n;
        for(int i=1;i<=n;i++) scanf("%d",&a[i]);
        sort(a+1,a+n+1);
        ll res=0;
        int now=0;
        for(int i=n;i>=1;){
            while(i>=1&&now<q[1]) res+=a[i--],now++;
            if(i<1) break;
            if(now==q[1]){
                now=2;
                while(now>0&&i>=1) now--,i--;
                now=0;
            }
        }
        cout<<res<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
const int maxn=1000100;
const int INF=1e9+10;

int m,n;
int q[maxn],a[maxn];

int main()
{
    //freopen("in.txt","r",stdin);
    while(cin>>m){
        for(int i=1;i<=m;i++) scanf("%d",&q[i]);
        sort(q+1,q+m+1);
        cin>>n;
        for(int i=1;i<=n;i++) scanf("%d",&a[i]);
        sort(a+1,a+n+1);
        ll res=0;
        int now=0;
        for(int i=n;i>=1;){
            while(i>=1&&now<q[m]) res+=a[i--],now++;
            if(i<1) break;
            if(now==q[m]){
                now=2;
                while(now>0&&i>=1) now--,i--;
                now=0;
            }
        }
        cout<<res<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define fs first
#define sc second
typedef long long ll;
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    int n , m , ai , mn = 10000000;
    vector<int> v;
    cin>>m ;
    for(int i = 0 ;i<m ;i++){
        cin>>ai;
        mn = min(ai,mn);

    }
    cin>>n;
    for(int i = 0 ;i<n ;i++){
        cin>>ai;
        v.push_back(ai);

    }
    sort(v.begin(),v.end());
    int free = 0;
    ll res = 0;
    int by =0;
    for(int i = n-1 ; i>=0 ;i--){
     if(by==mn-1) {
            res+=v[i];
            by =0;
            free=2;

    }else if(!free){
            res+=v[i];
            by++;

        }else free--;

    }
    cout<<res;

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define fs first
#define sc second
typedef long long ll;
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    int n , m , ai , mn = 10000000;
    vector<int> v;
    cin>>m ;
    for(int i = 0 ;i<m ;i++){
        cin>>ai;
        mn = min(ai,mn);

    }
    cin>>n;
    for(int i = 0 ;i<n ;i++){
        cin>>ai;
        v.push_back(ai);

    }
    sort(v.begin(),v.end());
    int free = 0;
    ll res = 0;
    int by =0;
    for(int i = n-1 ; i>=0 ;i--){
     if(by==mn-1 && !free) {
            res+=v[i];
            by =0;
            free=2;

    }else if(!free){
            res+=v[i];
            by++;

        }else free--;

    }
    cout<<res;

    return 0;

}


//http://codeforces.com/problemset/problem/261/A

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ar array

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int m;
    cin >> m;
    int q=0;

    for(int i = 0; i < m; ++i){
        int tmp;
        cin >> tmp;
        if(!q)
            q=tmp;
        else
            q = min(q,tmp);
    }

    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; ++i){
        cin >> a[i];
    }
    sort(a, a+n);
    int i = n-1;
    int sum = 0;
    while(i >= 0){
        int t = i-q >= 0 ? i-q+1 : 0;
        while(i >= t){
            sum += a[i--];
        }
        i -= 2;
    }
    cout << sum << '\n';
}

//1
//2
//12
//8 9 9 9 10 10 10 11 11 20 30 32
//
//101

//1
//1
//7
//1 1 1 1 1 1 1
//
//3


//http://codeforces.com/problemset/problem/261/A

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ar array

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int m;
    cin >> m;
    int q=0;

    for(int i = 0; i < m; ++i){
        int tmp;
        cin >> tmp;
        if(!q)
            q=tmp;
        else
            q = min(q,tmp);
    }

    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; ++i){
        cin >> a[i];
    }
    sort(a, a+n);
    int x = 0;
    int sum = 0;
    int i = 0;
    while(x < n){
        x += min(2, (n-x)/2);
        int t=x;
        while(x < min(t+q,n)){
            sum += a[x++];
        }
        if (x >= n-1){
            break;
        }
    }
    if(n%2==1)
        sum += a[n-1];
    cout << sum << '\n';
}


//http://codeforces.com/problemset/problem/261/A

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ar array

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int m;
    cin >> m;
    int q=0;

    for(int i = 0; i < m; ++i){
        int tmp;
        cin >> tmp;
        if(!q)
            q=tmp;
        else
            q = min(q,tmp);
    }

    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; ++i){
        cin >> a[i];
    }
    sort(a, a+n);
    int x = 0;
    int sum = 0;
    int i = 0;
    while(x < n){
        x += min(2, (n-x)/2);
        if (x >= n-1){
            sum += a[n-1];
            break;
        }
        int t=x;
        while(x < min(t+q,n)){
            sum += a[x++];
        }
    }
    cout << sum << '\n';
}


// general.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
//#include<bits/stdc++.h>
#include <fstream>
#include<cstdio>
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<functional>
#include<numeric>
#include<string.h>
#include<cstring>
#include<cstdlib>
#include<string>
#include<vector>
#include<complex>
#include<sstream>
#include<iterator>
#include<set>
#include<bitset>
#include<map>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<utility>
#include <iomanip> // for setpricision
#include<cmath>
#include<math.h>
#include<time.h>
using namespace std;
typedef vector<int> VI;
typedef unsigned long long ll;
#define fr(x, b, e) for(int x = b; x <= (e); ++x)
#define fd(x, b, e) for(int x = e; x >= (b); --x)
#define rep(x, n) for(int x = 0; x < (n); ++x)
#define VAR(v, n) __typeof(n) v = (n)
#define FILL(a, v) memset(a, v, sizeof(a))
#define sz(a) ((int)a.size())
#define FOREACH(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
const double EPS = 10e-9;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<double> VD;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<PII> VPII;
using namespace std;
#define pb push_back
#define mp make_pair
#define all(_v) (_v).begin(),(_v).end()
const ll MOD = 1000000009;
const int INF = 1000000001;
//const ll INFLL = 1e12;

const double INF_double = 1e18;

const int MAXN = 100010;
int discount[MAXN], items[MAXN];

bool cmpFunc(const int &a, const int &b) {
	return a > b;
}

int main() {
	ios_base::sync_with_stdio(false);

	int m; cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> discount[i];
	}

	sort(discount, discount + m);

	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> items[i];
	}

	sort(items, items + n, cmpFunc);

	ll ans = 0;
	for (int i = 0; i < n; ) {
		if ((i + 1) % discount[0] == 0) {
			ans += items[i];
			i++;
			i++;
		}
		else {
			ans += items[i];
		}
		i++;
	}

	cout << ans << '\n';

	//system("pause");
	return 0;
}


// general.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
//#include<bits/stdc++.h>
#include <fstream>
#include<cstdio>
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<functional>
#include<numeric>
#include<string.h>
#include<cstring>
#include<cstdlib>
#include<string>
#include<vector>
#include<complex>
#include<sstream>
#include<iterator>
#include<set>
#include<bitset>
#include<map>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<utility>
#include <iomanip> // for setpricision
#include<cmath>
#include<math.h>
#include<time.h>
using namespace std;
typedef vector<int> VI;
typedef unsigned long long ll;
#define fr(x, b, e) for(int x = b; x <= (e); ++x)
#define fd(x, b, e) for(int x = e; x >= (b); --x)
#define rep(x, n) for(int x = 0; x < (n); ++x)
#define VAR(v, n) __typeof(n) v = (n)
#define FILL(a, v) memset(a, v, sizeof(a))
#define sz(a) ((int)a.size())
#define FOREACH(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
const double EPS = 10e-9;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<double> VD;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<PII> VPII;
using namespace std;
#define pb push_back
#define mp make_pair
#define all(_v) (_v).begin(),(_v).end()
const ll MOD = 1000000009;
const int INF = 1000000001;
//const ll INFLL = 1e12;

const double INF_double = 1e18;

const int MAXN = 100010;
int discount[MAXN], items[MAXN];

bool cmpFunc(const int &a, const int &b) {
	return a > b;
}

int main() {
	ios_base::sync_with_stdio(false);

	int m; cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> discount[i];
	}

	sort(discount, discount + m);

	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> items[i];
	}

	sort(items, items + n, cmpFunc);

	ll ans = 0;
	int cnt = 0;
	for (int i = 0; i < n; ) {
		if (cnt && cnt % discount[0] == 0) {
			i++;
		}
		else {
			ans += items[i];
			cnt++;
		}
		i++;
	}

	cout << ans << '\n';

	system("pause");
	return 0;
}


// general.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
//#include<bits/stdc++.h>
#include <fstream>
#include<cstdio>
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<functional>
#include<numeric>
#include<string.h>
#include<cstring>
#include<cstdlib>
#include<string>
#include<vector>
#include<complex>
#include<sstream>
#include<iterator>
#include<set>
#include<bitset>
#include<map>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<utility>
#include <iomanip> // for setpricision
#include<cmath>
#include<math.h>
#include<time.h>
using namespace std;
typedef vector<int> VI;
typedef unsigned long long ll;
#define fr(x, b, e) for(int x = b; x <= (e); ++x)
#define fd(x, b, e) for(int x = e; x >= (b); --x)
#define rep(x, n) for(int x = 0; x < (n); ++x)
#define VAR(v, n) __typeof(n) v = (n)
#define FILL(a, v) memset(a, v, sizeof(a))
#define sz(a) ((int)a.size())
#define FOREACH(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
const double EPS = 10e-9;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<double> VD;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<PII> VPII;
using namespace std;
#define pb push_back
#define mp make_pair
#define all(_v) (_v).begin(),(_v).end()
const ll MOD = 1000000009;
const int INF = 1000000001;
//const ll INFLL = 1e12;

const double INF_double = 1e18;

const int MAXN = 100010;
int discount[MAXN], items[MAXN];

bool cmpFunc(const int &a, const int &b) {
	return a > b;
}

int main() {
	ios_base::sync_with_stdio(false);

	int m; cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> discount[i];
	}

	sort(discount, discount + m);

	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> items[i];
	}

	sort(items, items + n, cmpFunc);

	ll ans = 0;
	int cnt = 0;
	for (int i = 0; i < n; ) {
		if (cnt && cnt % discount[0] == 0) {
			i++;
		}
		else {
			ans += items[i];
			cnt++;
		}
		i++;
	}

	cout << ans << '\n';

	//system("pause");
	return 0;
}


// general.cpp : Defines the entry point for the console application.
//

//#include<bits/stdc++.h>
#include <fstream>
#include<cstdio>
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<functional>
#include<numeric>
#include<string.h>
#include<cstring>
#include<cstdlib>
#include<string>
#include<vector>
#include<complex>
#include<sstream>
#include<iterator>
#include<set>
#include<bitset>
#include<map>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<utility>
#include <iomanip> // for setpricision
#include<cmath>
#include<math.h>
#include<time.h>
using namespace std;
typedef vector<int> VI;
typedef unsigned long long ll;
#define fr(x, b, e) for(int x = b; x <= (e); ++x)
#define fd(x, b, e) for(int x = e; x >= (b); --x)
#define rep(x, n) for(int x = 0; x < (n); ++x)
#define VAR(v, n) __typeof(n) v = (n)
#define FILL(a, v) memset(a, v, sizeof(a))
#define sz(a) ((int)a.size())
#define FOREACH(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
const double EPS = 10e-9;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<double> VD;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<PII> VPII;
using namespace std;
#define pb push_back
#define mp make_pair
#define all(_v) (_v).begin(),(_v).end()
const ll MOD = 1000000009;
const int INF = 1000000001;
//const ll INFLL = 1e12;

const double INF_double = 1e18;

const int MAXN = 100010;
int discount[MAXN], items[MAXN];

bool cmpFunc(const int &a, const int &b) {
	return a > b;
}

int main() {
	ios_base::sync_with_stdio(false);

	int m; cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> discount[i];
	}

	sort(discount, discount + m);

	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> items[i];
	}

	sort(items, items + n, cmpFunc);

	ll ans = 0;
	int cnt = 0;
	for (int i = 0; i < n; ) {
		if (cnt && cnt % discount[0] == 0) {
			i++;
			cnt = 0;
		}
		else {
			ans += items[i];
			cnt++;
		}
		i++;
	}

	cout << ans << '\n';

	return 0;
}


#include<bits/stdc++.h>

#define ll long long
#define dl double

using namespace std;

ll a[100010];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ll m;
    cin >> m;

    ll mn = 9999999999;
    //map<ll, ll> mp;

    for(ll i = 0; i < m; i++){
        ll x;
        cin >> x;
        //mp[x] = 1;
        mn = min(mn, x);
    }

    ll n;
    cin >> n;

    for(ll i = 1; i <= n; i++){
        cin >> a[i];
    }

    sort(a + 1, a + n + 1);

    for(ll i = 1; i <= n / 2; i++){
        swap(a[i], a[n - i + 1]);
    }

    ll S = 0, cnt = 0;
    for(ll i = 1; i <= n;){
        cnt++;
        if(cnt == mn) S += a[i], i += 3, cnt = 0;
        else S += a[i], i++;
    }

    //ll x = n / (mn + 2) * (mn + 2);
    //if(mp[n - x - 1]) S -= a[n];

    return cout << S << '\n', 0;
}


#include<bits/stdc++.h>

#define ll long long
#define dl double

using namespace std;

ll a[100010];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ll m;
    cin >> m;

    ll mn = 9999999999;
    map<ll, ll> mp;

    for(ll i = 0; i < m; i++){
        ll x;
        cin >> x;
        mp[x] = 1;
        mn = min(mn, x);
    }

    ll n;
    cin >> n;

    for(ll i = 1; i <= n; i++){
        cin >> a[i];
    }

    sort(a + 1, a + n + 1);

    for(ll i = 1; i <= n / 2; i++){
        swap(a[i], a[n - i + 1]);
    }

    ll S = 0, cnt = 0;
    for(ll i = 1; i <= n;){
        cnt++;
        if(cnt == mn) S += a[i], i += 3, cnt = 0;
        else S += a[i], i++;
    }

    ll x = n / (mn + 2) * (mn + 2);
    if(mp[n - x - 1]) S -= a[n];

    return cout << S << '\n', 0;
}


#include<bits/stdc++.h>

#define ll long long
#define dl double

using namespace std;

ll a[100010];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ll m;
    cin >> m;

    ll mn = 9999999999;

    for(ll i = 0; i < m; i++){
        ll x;
        cin >> x;
        mn = min(mn, x);
    }

    ll n;
    cin >> n;

    for(ll i = 1; i <= n; i++){
        cin >> a[i];
    }

    sort(a + 1, a + n + 1);

    for(ll i = 1; i <= n / 2; i++){
        swap(a[i], a[n - i + 1]);
    }

    ll S = 0, cnt = 0;
    for(ll i = 1; i <= n;){
        cnt++;
        if(cnt == mn) S += a[i], i += 3, cnt = 0;
        else S += a[i], i++;
    }

    return cout << S << '\n', 0;
}


#include <bits/stdc++.h>

using namespace std;
long long k[123456];
long long arr[123456];

int main()
{
    long long m,n;
    cin>>m;
    for(int i=0;i<m;i++) cin>>k[i];
    sort(k,k+m);
    long long z=k[0];
    cin>>n;
    for(int i=0;i<n;i++) cin>>arr[i];
    sort(arr,arr+n);
    reverse(arr,arr+n);
    long long ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<z;j++)
        {
            ans+=arr[i];
            i++;
        }
        i++;
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
long long k[123456];
long long arr[523456];

int main()
{
    long long m,n;
    cin>>m;
    for(int i=0;i<m;i++) cin>>k[i];
    sort(k,k+m);
    long long z=k[0];
    cin>>n;
    for(int i=0;i<n;i++) cin>>arr[i];
    sort(arr,arr+n);
    reverse(arr,arr+n);
    long long ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<z;j++)
        {
            ans+=arr[i];
            i++;
        }
        i++;
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int m,n;
int a[100005];
int b[100005];
int main()
{
    cin>>m;
    for(int i=0;i<m;i++)cin>>a[i];
    cin>>n;
    for(int i=0;i<n;i++)cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    int ans = 0;
    int cnt = 0;
    for(int i=n-1;i>=0;i--)
    {
        if(cnt == a[0])
        {
            if(i-1>= 0) i--;
            if(i-1>=0) i--;
            cnt = 0;
        }
        else
        {
            cnt++;
            ans += b[i];
        }
    }
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int m,n;
int a[100005];
int b[100005];
int main()
{
    cin>>m;
    for(int i=0;i<m;i++)cin>>a[i];
    cin>>n;
    for(int i=0;i<n;i++)cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    int ans = 0;
    int cnt = 0;
    for(int i=n-1;i>=0;i--)
    {
        if(cnt == a[0])
        {
            if(i-1>= 0) i--;
            cnt = 0;
        }
        else
        {
            cnt++;
            ans += b[i];
        }
        //cout<<ans<<" "<<i<<endl;
    }
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const long long maxn=101111;
long long n,m,a[maxn],q[maxn],mi=999999999;
int main(){
	cin>>m;
	for(long long i=1;i<=m;i++){
		cin>>q[i];
		mi=min(mi,q[i]);
	}
	cin>>n;
	for(long long i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+1+n);
	reverse(a+1,a+1+n);
	long long ans=0;
	for(long long i=1;i<=n;i++){
		if(i+mi-1<=n){
			for(long long j=i;j<=i+mi-1;j++)ans+=a[j];
			i=i+mi+1;
		}else{
			for(long long j=i;j<=n;j++)ans+=a[j];
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#define il inline
#define re register
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
int n, q;
int discount[maxn], a[maxn];
ll ans = 0;
int main() {
	scanf("%d", &q);
	for(re int i = 1; i <= q; ++i)
		scanf("%d", &discount[i]);
	sort(discount+1, discount+q+1);
	scanf("%d", &n);
	for(re int i = 1; i <= n; ++i)
		scanf("%d", &a[i]);
	sort(a+1, a+n+1);
	if(n > discount[1]) {
		int cnt = discount[1], tmp = 0, top = a[n];
		while(a[n] == top && n > 0) {
			if(tmp == cnt) {
				tmp = 0;
				n -= 2;
				continue;
			}
			ans += top;
			n--;
			tmp++;
		}
		if(n > 0) {
			if(tmp+n < cnt) {
				for(re int i = 1; i <= n; ++i)
					ans += a[i];
				printf("%lld\n", ans);
			}else {
				for(re int i = 1; i <= cnt-tmp; ++i)
					ans += a[i];
				n -= 2;
				tmp = cnt-tmp;//前面用了几个
				while(n > 0) {
					for(re int i = 1; i <= cnt; ++i)
						ans += a[i+tmp];
					n -= 2;
					tmp += (cnt+2);
				}
				printf("%lld\n", ans);
			}
		}else printf("%lld\n", ans);
	}else {
		for(re int i = 1; i <= n; ++i)
			ans += a[i];
		printf("%lld\n", ans);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=10111;
int n,m,a[maxn],q[maxn],mi=999999;
int main(){
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>q[i];
		mi=min(mi,q[i]);
	}
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+1+n);
	reverse(a+1,a+1+n);
	long long ans=0;
	for(int i=1;i<=n;i++){
		if(i+mi-1<=n){
			for(int j=i;j<=i+mi-1;j++)ans+=a[j];
			i=i+mi+1;
		}else{
			for(int j=i;j<=n;j++)ans+=a[j];
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#define il inline
#define re register
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
int n, q;
int discount[maxn], a[maxn];
ll ans = 0;
int main() {
	scanf("%d", &q);
	for(re int i = 1; i <= q; ++i)
		scanf("%d", &discount[i]);
	sort(discount+1, discount+q+1);
	scanf("%d", &n);
	for(re int i = 1; i <= n; ++i)
		scanf("%d", &a[i]);
	sort(a+1, a+n+1);
	if(n > discount[1]) {
		int cnt = discount[1], tmp = 0, top = a[n];
		while(a[n] == top && n > 0) {
			if(tmp == cnt) {
				tmp = 0;
				n -= 2;
				continue;
			}
			ans += top;
			n--;
			tmp++;
		}
		n -= (tmp/cnt) << 1;
		tmp %= cnt;
		if(n > 0) {
			for(re int i = 1; i <= cnt-tmp; ++i)
			//从1开始选
				ans += a[i];
			if(cnt+2 >= n) {
				printf("%lld\n", ans);
				return 0;
			}
			tmp = cnt+2;
			while(tmp < n) {
				for(re int i = 1; i <= cnt; ++i)
					ans += a[i+tmp];
				n -= 2;
			}
			printf("%lld", ans);
		}else printf("%lld\n", ans);
	}else {
		for(re int i = 1; i <= n; ++i)
			ans += a[i];
		printf("%lld\n", ans);
	}
	return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
#include<string.h>
#include<cstdint>
#include<stdint.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define int32 int32_t
#define mod 1000000007
#define inf 1000000000000000009
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi std::vector
#define pi std::pair

using namespace std;

void solve()  {
	int n;
	cin >> n;
	vi<int> a(n);
	int mn = 0;
	for(int i = 0;i<n;i++)  {
		cin >> a[i];
		if(mn < a[i]) {
			mn = a[i];
		}
	}
	int m;
	cin >> m;
	vi<int> b(m);
	for(int i = 0;i<m;i++)  {
		cin >> b[i];
	}
	sort(all(b));
	reverse(all(b));
	int sm = 0;
	for(int i = 0;i<m;i++)  {
		if(i % (mn + 2) < mn) {
			sm += b[i];
		}
	}
	cout << sm << endl;
}

int32 main()  {
	IOS;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
#include<string.h>
#include<cstdint>
#include<stdint.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define int32 int32_t
#define mod 1000000007
#define inf 1000000000000000009
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi std::vector
#define pi std::pair

using namespace std;

void solve()  {
	int n;
	cin >> n;
	vi<int> a(n);
	int mn = 0;
	for(int i = 0;i<n;i++)  {
		cin >> a[i];
		if(mn < a[i]) {
			mn = a[i];
		}
	}
	int m;
	cin >> m;
	vi<int> b(m);
	for(int i = 0;i<m;i++)  {
		cin >> b[i];
	}
	sort(rall(b));
	int i = 0;
	int sm = 0;
	while(i < m)  {
		int tt = i;
		for(i;i<tt + mn;i++)  {
			sm += b[i];
		}
		i += 2;
	}
	cout << sm << endl;
}

int32 main()  {
	IOS;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
#include<string.h>
#include<cstdint>
#include<stdint.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define int32 int32_t
#define mod 1000000007
#define inf 1000000000000000009
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi std::vector
#define pi std::pair

using namespace std;

void solve()  {
	int n;
	cin >> n;
	vi<int> a(n);
	int mn = 0;
	for(int i = 0;i<n;i++)  {
		cin >> a[i];
		if(mn < a[i]) {
			mn = a[i];
		}
	}
	int m;
	cin >> m;
	vi<int> b(m);
	for(int i = 0;i<m;i++)  {
		cin >> b[i];
	}
	sort(rall(b));
	int i = 0;
	int sm = 0;
	while(i < m)  {
		int tt = i;
		for(i;i<tt + mn && i < m;i++)  {
			sm += b[i];
		}
		i += 2;
	}
	cout << sm << endl;
}

int32 main()  {
	IOS;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
#include<string.h>
#include<cstdint>
#include<stdint.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define int32 int32_t
#define mod 1000000007
#define inf 1000000000000000009
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi std::vector
#define pi std::pair

using namespace std;

void solve()  {
	int n;
	cin >> n;
	vi<int> a(n);
	int mn = 0;
	for(int i = 0;i<n;i++)  {
		cin >> a[i];
		if(mn < a[i]) {
			mn = a[i];
		}
	}
	int m;
	cin >> m;
	vi<int> b(m);
	for(int i = 0;i<m;i++)  {
		cin >> b[i];
	}
	sort(rall(b));
	int sm = 0;
	for(int i = 0;i<m;i++)  {
		if(i % (mn + 2) < mn) {
			sm += b[i];
		}
	}
	cout << sm << endl;
}

int32 main()  {
	IOS;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
#include<string.h>
#include<cstdint>
#include<stdint.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define int32 int32_t
#define mod 1000000007
#define inf 1000000000000000009
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi std::vector
#define pi std::pair

using namespace std;

void solve()  {
	int n;
	cin >> n;
	vi<int> a(n);
	int mn = inf;
	for(int i = 0;i<n;i++)  {
		cin >> a[i];
		if(mn > a[i]) {
			mn = a[i];
		}
	}
	int m;
	cin >> m;
	vi<int> b(m);
	for(int i = 0;i<m;i++)  {
		cin >> b[i];
	}
	sort(all(b));
	reverse(all(b));
	int sm = 0;
	for(int i = 0;i<m;i++)  {
		if(i % (mn + 2) < mn) {
			sm += b[i];
		}
	}
	cout << sm << endl;
}

int32 main()  {
	IOS;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
#include<string.h>
#include<cstdint>
#include<stdint.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define int32 int32_t
#define mod 1000000007
#define inf 1000000000000000009
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vi std::vector
#define pi std::pair

using namespace std;

void solve()  {
	int n;
	cin >> n;
	vi<int> a(n);
	int mn = inf;
	for(int i = 0;i<n;i++)  {
		cin >> a[i];
		if(mn < a[i]) {
			mn = a[i];
		}
	}
	int m;
	cin >> m;
	vi<int> b(m);
	for(int i = 0;i<m;i++)  {
		cin >> b[i];
	}
	sort(all(b));
	reverse(all(b));
	int sm = 0;
	for(int i = 0;i<m;i++)  {
		if(i % (mn + 2) < mn) {
			sm += b[i];
		}
	}
	cout << sm << endl;
}

int32 main()  {
	IOS;
	solve();
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n, m;
int q;
vector<int> price;
vector<int> prefix;

int main() {

	cin >> m;
	for (int i = 0; i < m; ++ i) {
		int qi;
		cin >> qi;
		if (i == 0 || qi < q) {
			q = qi;
		}
	}
	cin >> n;
	price.resize(n);
	prefix.resize(n);
	for (int i = 0; i < n; ++ i) {
		cin >> price[i];
		if (i == 0) {
			prefix[i] = price[i];
		} else {
			prefix[i] = prefix[i - 1] + price[i];
		}
	}

	vector<int> dp(n, 0);
	for (int i = 0; i < q && i < n; ++ i) {
		dp[i] = prefix[i];
	}
	for (int i = q; i < n; ++ i) {
		int free0 = prefix[i] - prefix[i - q] + dp[i - q];
		int free1 = free0;
		if (i <= q) {
			free1 = prefix[i] - prefix[i - q];
		} else {
			free1 = prefix[i] - prefix[i - q] + dp[i - q - 1];
		}
		int free2 = free1;
		if (i == q + 1) {
			free2 = prefix[i] - prefix[i - q];
		} else if (i > q + 1) {
			free2 = prefix[i] - prefix[i - q] + dp[i - q - 2];
		}
		// cout << i << ' ' << free0 << ' ' << free1 << ' ' << free2 << endl;
		dp[i] = min(min(free0, free1), free2);
	}

	cout << dp[n - 1] << endl;

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n, m;
int q;
vector<int> price;
vector<int> prefix;

int main() {

	cin >> m;
	for (int i = 0; i < m; ++ i) {
		int qi;
		cin >> qi;
		if (i == 0 || qi < q) {
			q = qi;
		}
	}
	cin >> n;
	price.resize(n);
	prefix.resize(n);
	for (int i = 0; i < n; ++ i) {
		cin >> price[i];
	}
	sort(price.begin(), price.end());
	prefix[0] = price[0];
	for (int i = 1; i < n; ++ i) {
		prefix[i] = prefix[i - 1] + price[i];
	}

	vector<int> dp(n, 0);
	for (int i = 0; i < q && i < n; ++ i) {
		dp[i] = prefix[i];
	}
	for (int i = q; i < n; ++ i) {
		int free0 = prefix[i] - prefix[i - q] + dp[i - q];
		int free1 = free0;
		if (i <= q) {
			free1 = prefix[i] - prefix[i - q];
		} else {
			free1 = prefix[i] - prefix[i - q] + dp[i - q - 1];
		}
		int free2 = free1;
		if (i == q + 1) {
			free2 = prefix[i] - prefix[i - q];
		} else if (i > q + 1) {
			free2 = prefix[i] - prefix[i - q] + dp[i - q - 2];
		}
		// cout << i << ' ' << free0 << ' ' << free1 << ' ' << free2 << endl;
		dp[i] = min(min(free0, free1), free2);
	}

	cout << dp[n - 1] << endl;

	return 0;
}


#include <iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
const int maxn=100005;
int main()
{
    int m,q,minq=INT_MAX,n,a[maxn];
    cin>>m;
    for(int i=0;i<m;i++)
    {
        scanf("%d",&q);
        minq=min(minq,q);
    }
    cin>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    sort(a,a+n);
    int ans=0;
    n-=m;
    n--;
    //cout<<"n: "<<n<<endl;
    if(n-1>=0) ans+=a[n-1];
    if(n-2>=0) ans+=a[n-2];
    ans=sum-ans;
    cout<<ans<<endl;
    //cout << "Hello world!" << endl;
    return 0;
}


#include <iostream>
#include<algorithm>
#include<cstdio>
#include<math.h>
using namespace std;
const int maxn=100005;
int main()
{
    int m,q,minq=1000000,n,a[maxn];
    cin>>m;
    for(int i=0;i<m;i++)
    {
        scanf("%d",&q);
        minq=min(minq,q);
    }
    cin>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    sort(a,a+n);
    int ans=0;
    for(int i=n-m-1;i>=0;i-=(m+2))
    {
        //cout<<"i: "<<i<<endl;
        //cout<<i-(m)<<" "<<i-(m+1)<<endl;
        if(i-1>=0) ans+=a[i-1];
        if(i-2>=0) ans+=a[i-2];
    }
    ans=sum-ans;
    cout<<ans<<endl;
    cin>>n;
    //cout << "Hello world!" << endl;
    return 0;
}


#include <iostream>
#include<algorithm>
#include<cstdio>
#include<math.h>
using namespace std;
const int maxn=100005;
int main()
{
    int m,q,minq=1000000,n,a[maxn];
    cin>>m;
    for(int i=0;i<m;i++)
    {
        scanf("%d",&q);
        minq=min(minq,q);
    }
    cin>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    sort(a,a+n);
    int ans=0;
    for(int i=n-m;i>=0;i-=(m+2))
    {
        cout<<"i: "<<i<<endl;
        cout<<i-(m)<<" "<<i-(m+1)<<endl;
        if(i-1>=0) ans+=a[i-1];
        if(i-2>=0) ans+=a[i-2];
    }
    ans=sum-ans;
    cout<<ans<<endl;
    cin>>n;
    //cout << "Hello world!" << endl;
    return 0;
}


#include <iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
const int maxn=100005;
int main()
{
    int m,q,minq=INT_MAX,n,a[maxn];
    cin>>m;
    for(int i=0;i<m;i++)
    {
        scanf("%d",&q);
        minq=min(minq,q);
    }
    cin>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    sort(a,a+n);
    int ans=0;
    n-=m;
    //cout<<"n: "<<n<<endl;
    if(n-1>=0) ans+=a[n-1];
    if(n-2>=0) ans+=a[n-2];
    ans=sum-ans;
    cout<<ans<<endl;
    //cout << "Hello world!" << endl;
    return 0;
}