For a finite set of integers X, let f(X)=\max X - \min X.

Given are N integers A_1,...,A_N.

We will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even when their values are the same, there are {}_N C_K ways to make this choice. Find the sum of f(S) over all those ways.

Since the answer can be enormous, print it \bmod (10^9+7).

Constraints

* 1 \leq N \leq 10^5
* 1 \leq K \leq N
* |A_i| \leq 10^9

Input

Input is given from Standard Input in the following format:


N K
A_1 ... A_N


Output

Print the answer \bmod (10^9+7).

Examples

Input

4 2
1 1 3 4


Output

11


Input

6 3
10 10 10 -10 -10 -10


Output

360


Input

3 1
1 1 1


Output

0


Input

10 6
1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0


Output

999998537
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        int N = ni();
        int K = ni();
        int[] a = new int[N];
        for (int i = 0; i < N; i++) {
            a[i] = ni();
        }
        int[] fac = new int[N+1];
        fac[0] = 1;
        for (int i = 1; i <= N; i++) {
            fac[i] = mul(fac[i-1],i);
        }
        int invKm1 = BigInteger.valueOf(fac[K-1]).modInverse(MOD).intValue();
        int invN = BigInteger.valueOf(fac[N]).modInverse(MOD).intValue();
        int[] facinv = new int[N+1];
        facinv[N] = invN;
        for (int i = N-1; i >=0; i--) {
            facinv[i] = mul(facinv[i+1],i+1);
        }
        // System.out.println(Arrays.toString(fac));
        // System.out.println(Arrays.toString(facinv));
        Arrays.sort(a);
        // BigInteger ans = BigInteger.ZERO;
        int ans = 0;
        for (int i = N-1; i>=K-1 ; i--) {
            // BigInteger v = BigInteger.valueOf(fac[i]);
            // v = v.multiply(BigInteger.valueOf(invKm1)).mod(MOD);
            // v = v.multiply(BigInteger.valueOf(facinv[i-K+1])).mod(MOD);
            // v = v.multiply(BigInteger.valueOf(a[i])).mod(MOD);
            // ans = ans.add(v).mod(MOD);
            int count = mul(mul(fac[i],invKm1),facinv[i-K+1]);
            ans = add(ans, mul(count,a[i]));
        }
        int sub = 0;
        for (int i = 0; i<=N-K; i++) {
            // BigInteger v = BigInteger.valueOf(fac[N-i-1]);
            // v = v.multiply(BigInteger.valueOf(invKm1)).mod(MOD);
            // v = v.multiply(BigInteger.valueOf(facinv[N-K-i])).mod(MOD);
            // v = v.multiply(BigInteger.valueOf(a[i])).mod(MOD);
            // ans = ans.subtract(v).mod(MOD);
            int count = mul(mul(fac[N-i-1],invKm1),facinv[N-K-i]);
            sub = add(sub, mul(count,a[i]));
        }
        ans = (ans - sub) % mod;
        if(ans<0) ans += mod;
        // out.println(ans.intValue());
        out.println(ans);
    }

    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);
    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}