#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, l;
  cin >> n >> l;
  long long cost[n];
  for (int i = 0; i < n; i++) cin >> cost[i];
  int N = 32;
  long long mincost[N];
  for (int i = 0; i < N; i++) {
    long long val = 1LL << 62;
    for (int j = 0; j < n; j++) {
      val = min(val, cost[j] * (1LL << max((i - j), 0)));
    }
    mincost[i] = val;
  }
  long long final_cost = 1LL << 62;
  for (int i = 0; i < N; i++) {
    if ((l & (1LL << i)) > 0) {
      final_cost += mincost[i];
      if ((((1LL << i) - 1) & l) == 0) final_cost = min(final_cost, mincost[i]);
    } else
      final_cost = min(final_cost, mincost[i]);
  }
  cout << final_cost << endl;
}
