N, M = map(int, input().split()) N -= 1 A = list(map(int, input().split())) + [0] mod = 10**9 + 7 comb = 1 inv = 1 for i in range(1, N + 1): comb *= M + i inv *= i comb %= mod inv %= mod inv = pow(inv, mod - 2, mod) comb = comb * inv % mod ans = 0 for i in range(N): ans += (A[i] - A[i - 1]) * (comb - 1) ans %= mod comb *= (N - i) * pow(N + M - i, mod - 2, mod) comb %= mod print(ans)