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.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main 
{
	static int n, k;
	static long[] a, lsum, rsum;
	static long MOD = 1000000007l;
	                //1000000007
	
	static long[] fact;
	static long[] afact;
	
	static long nCr(int n, int r)
	{
		return ((fact[n] * afact[n-r])%MOD * afact[r])%MOD;
	}
	
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int k = sc.nextInt();
		a = new long[n];
		
		fact = new long[100001];
		afact = new long[100001];
		
		fact[0] = 1;
		BigInteger bimod = new BigInteger(Long.toString(MOD));
		BigInteger bi;
		for(int i = 0; i <= 100000; i++)
		{
			if(i>0)fact[i] = (fact[i-1] * i)%MOD;
			bi = new BigInteger(Long.toString(fact[i]));
			afact[i] = bi.modInverse(bimod).longValueExact();
		}
		
//		System.out.println("Done " + afact[0]);
		
		
		long sum = 0;
		
		for(int i = 0; i < n; i++)
		{
			a[i] = sc.nextLong();
			sum = (sum + a[i])%MOD;
		}
		
		Arrays.sort(a);
		
		//count rightsums and leftsums
		lsum = new long[n];
		rsum = new long[n];
		
		for(int i = 0; i < n; i++)
		{
			lsum[i] = a[i];
			if(i>0)lsum[i] = (lsum[i] + lsum[i-1])%MOD;
			
			if(i>0)rsum[i] = (rsum[i-1] - a[i-1])%MOD;
			else rsum[i] = sum;
		}
		
//		System.out.println(Arrays.toString(a));
//		System.out.println(Arrays.toString(lsum));
//		System.out.println(Arrays.toString(rsum));
		//count difsums
		
		long an = 0;
		
		if(k>1)
			for(int d = k-1; d < n; d++)
			{
				long difsum = rsum[d] - lsum[n-d-1];
				long ncr = nCr(d-1,k-2);
//				System.out.println("d=" + d + ": difsum " + difsum + " " + ncr + ", n " + (d-1) + ", r " + (k-2));
				an = (an + (difsum*nCr(d-1,k-2))%MOD)%MOD;
			}
		an = an%MOD;
		if(an<0)an+=MOD;
		
		System.out.println(an);
	}

}
