#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int MOD = 1000000007;
int N, M;

ll expo(ll a, ll b)
{
    if (b == 0)
        return 1;
    if (b == 1)
        return a % MOD;
    if (b % 2 == 0)
        return expo(a*a % MOD, b/2);
    return a*expo(a*a % MOD, (b-1)/2) % MOD;
}

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

    cin >> N >> M;
    int sum = 0;
    for (int i = 0, a; i < N; i++)
    {
        cin >> a;
        sum += a;
    }

    ll num = 1, dem = 1;
    for (int i = 0; i < sum + N; i++)
    {
        num = num*(M + N - i) % MOD;
        dem = dem*(i + 1) % MOD;
    }

    cout << num*expo(dem, MOD - 2) % MOD << "\n";

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
  int n;
  cin >> n;
  vector<ll> a(n);
  for (ll &i : a)
    cin >> i;
  sort(a.begin(), a.end());
  ll ans = 0;
  for (int i = 0; i != n; i++)
    ans += i * a[i] - (n - (i + 1)) * a[i];
  cout << ans << endl;
  return 0;
}