#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int l;
  cin >> n >> l;
  vector<long long int> c(31);
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (int i = 1; i < 31; i++) {
    if (i < n) {
      c[i] = (((c[i]) < (2 * c[i - 1])) ? (c[i]) : (2 * c[i - 1]));
    } else
      c[i] = 2 * c[i - 1];
  }
  int k = 0;
  long long int x = 0;
  while (l) {
    if (x > c[k]) x = c[k];
    if (l & 1ll) x += c[k];
    k++;
    l /= 2;
  }
  long long int answer = x;
  for (int i = k; i < 31; i++) {
    answer = (((answer) < (c[i])) ? (answer) : (c[i]));
  }
  cout << answer;
  return 0;
}
