import std.algorithm, std.array, std.conv, std.range, std.stdio, std.string;
import std.functional;

void main()
{
    auto buf = readln.chomp.split.to!(int[]);
    immutable size_t nPopulation = buf[0], kSubset = buf[1];
    auto a = readln.chomp.split.to!(int[]).sort().array;
    Mod1e9p7 answer;
    foreach (i, e; a)
        answer -= binaryCoefficient(nPopulation - i, kSubset - 1) * e;
    foreach (j, e; a)
        answer += binaryCoefficient(j, kSubset - 1) * e;
    answer.writeln;
}

struct Mod1e9p7
{
    enum long mod = 10_0000_0007;
    long value;
    Mod1e9p7 opOpAssign(string op)(in Mod1e9p7 rhs)
        if (op == "+" || op == "-" || op == "*")
    {
        return opOpAssign!op(rhs.value);
    }
    Mod1e9p7 opOpAssign(string op)(in long rhs)
        if (op == "+" || op == "-" || op == "*")
    {
        mixin ("value "~op~"= rhs;"); 
        value %= mod;
        return this;
    }
    Mod1e9p7 opBinary(string op)(in long rhs) const
        if (op == "+" || op == "-" || op == "*")
    {
        auto copy = cast()this;
        copy.opOpAssign!op(rhs);
        return copy;
    }
    Mod1e9p7 opBinary(string op)(in Mod1e9p7 rhs) const
        if (op == "+" || op == "-" || op == "*")
    {
        return this.opBinary!op(rhs.value);
    }
    Mod1e9p7 opBinary(string op)(in long rhs) const
        if (op == "^^")
    {
        if (rhs == 0) return Mod1e9p7(1);
        if (rhs == 1) return this;
        auto sqhalf = (this * this) ^^ (rhs >> 1);
        return (rhs & 1) ? sqhalf * this : sqhalf;
    }
    Mod1e9p7 opBinary(string op)(in Mod1e9p7 rhs) const
        if (op == "/")
    {
        assert (rhs.value);
        return this * rhs ^^ (mod - 2);
    }
}
Mod1e9p7 binaryCoefficient(ptrdiff_t n, ptrdiff_t r)
{
    if (r < 0 || n < r) return Mod1e9p7(0);
    return factorial(n) / factorial(r) / factorial(n - r);
}
Mod1e9p7 factorial(ptrdiff_t n)
{
    assert (0 <= n);
    if (n < 2) return Mod1e9p7(1);
    return memoize!factorial(n - 1) * n;
}
