#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 30 + 5;
long long cost[MAX_N];
long long n, l;
bool check(long long money) {
  long long liter = 0;
  for (int i = n; i >= 1; i--) {
    if (money >= cost[i]) {
      long long p = money / cost[i];
      if (p >= l) return true;
      liter += p * (1 << (i - 1));
      money -= p * cost[i];
    }
  }
  cout << endl;
  return liter >= l;
}
int main(void) {
  cin >> n >> l;
  for (int i = 1; i <= n; i++) cin >> cost[i];
  for (int i = 2; i <= n; i++) cost[i] = min(cost[i], cost[i - 1] * 2);
  long long l = 1, r = 1e18, mid;
  long long ans;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  cout << ans << endl;
}
