import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.datetime;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto L = s[1].to!long;
    auto C = readln.split.map!(to!long).array;
    foreach (i; 0..N-1) C[i+1] = min(C[i]*2, C[i+1]);

    auto X = L >> (N-1);
    auto Y = L - (X << (N-1));
    long tmp = X * C[N-1];
    long ans = 1L << 60;

    for (int i = N-2; i >= 0; --i) {
        if (Y == 0) break;
        if (Y & (1L << i)) {
            for (int j = N-1; j > i; --j) {
                ans = min(ans, tmp + C[j]);
            }
            tmp += C[i];
        }
    }

    ans = min(ans, tmp);
    ans.writeln;
}
