#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30 + 3;
struct Node {
  long long c, t;
  bool operator<(const Node &x) const {
    return (double)c / t < (double)x.c / x.t;
  }
} P[MAXN];
long long n, L, lft, ans, EXans = LLONG_MAX;
int main() {
  scanf("%I64d%I64d", &n, &L), lft = L;
  for (int i = 1; i <= n; i++) scanf("%I64d", &P[i].c), P[i].t = 1 << i - 1;
  sort(P + 1, P + 1 + n);
  for (int i = 1; i <= n; i++) {
    long long t0 = (long long)floor((double)lft / P[i].t),
              t1 = (long long)ceil((double)lft / P[i].t) * P[i].c,
              t2 = t0 * P[i].c;
    lft -= t0 * P[i].t, EXans = min(EXans, ans + t1), ans += t2;
  }
  printf("%I64d", EXans);
  return 0;
}
