#include<bits/stdc++.h>
using namespace::std;

int main() {
    int n, k;
    scanf("%d %d", &n, &k);
    priority_queue<long long, vector<long long>, greater<long long>> Q;
    for(int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        Q.emplace(x);
    }
    int cnt = 0;
    while(Q.size() >= 2 and Q.top() < k) {
        long long x = Q.top(); Q.pop();
        long long y = Q.top(); Q.pop();
        Q.emplace(x + 2 * y);
        cnt += 1;
    }
    if(Q.top() < k) puts("-1");
    else printf("%d\n", cnt);
    return 0;
}