import math

N, K = map(int, input().split())
cookies = list(map(int, input().split()))
happines = (sum(cookies) - N) * K
multiplied = 1

def ncr(n, k):
    return int(math.factorial(n) / (math.factorial(k) * math.factorial(n - k)))

for i in cookies:
    multiplied = multiplied * ncr(int(N), int(i))
res = int(happines * multiplied)
print(res)