#include <bits/stdc++.h>

using namespace std;

#define SOLVER(x) solve_C x

static void s_solve(void)
{
    long long N;
    long long M;
    long long L;

    cin >> N >> M;

    L = 1;
    if ( M == 0 )
    {
        for ( int i = 0; i < N; i++ )
        {
            cout << L << " " << L+1 << endl;
            L += 2;
        }
        return;
    }

    if ( ( M < 0 ) || ( M > ( N - 2 ) ) )
    {
        cout << "-1" << endl;
        return;
    }

    L = 2;
    for ( int i = 0; i < ( M + 1 ); i++ )
    {
        cout << L << " " << L+1 << endl;
        L += 2;
    }
    cout << "1 " << L << endl;
    L++;

    for ( int i = 0; i < ( N - ( M + 2 ) ); i++ )
    {
        cout << L << " " << L+1 << endl;
        L += 2;
    }

    return;
}

void SOLVER((volatile bool *do_loop))
{
    do {
        s_solve();
    } while ((do_loop != NULL) && (*do_loop));
}

#ifndef NO_PROBLEM_MAIN
int main(void)
{
    SOLVER((NULL));
    return 0;
}
#endif

#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define rep(i, a, b) for(int i = a; i < b; ++i)

int debug = 0;

const int N = 55;
int n, x, lst, a[N], bit[N], dp[N][2];

main() {
    cin >> n >> x;
    rep(i, 1, n + 1) cin >> a[i];
    for (int i = n; i > 0; --i) {
        bit[i] = x / a[i];
        x %= a[i];
    }
    dp[0][0] = 1;
    rep(i, 1, n + 1) {
        dp[i][0] = dp[i - 1][0];
        if ((bit[i] + 1) != a[i + 1] / a[i]) {
            dp[i][0] += dp[i - 1][1];
        }
        dp[i][1] = dp[i - 1][1];
        if (bit[i] > 0) {
            dp[i][1] += dp[i - 1][0];
        }
    }
    cout << dp[n][0] << '\n';
}