N, K = map(int, input().split()) sumA = sum(map(int, input().split())) print(pow(2, K, 10 ** 9 + 7) * sumA % (10 ** 9 + 7))