function Main(input) {
	input = input.trim().split("\n").map(function(x) { return x.split(" ")});
	var N = parseInt(input[0][0], 10);
	var M = parseInt(input[0][1], 10);
	var vec_a = input[1].map(e => parseInt(e, 10));
    var ans = calc(vec_a, N, M);
    console.log(ans);
}

function calc(vec_a, N, M){
    if (N > 1){
        var howManyDividedBy2 = 0;
        while(vec_a[0] % 2 === 0){
            vec_a[0] /= 2;
            howManyDividedBy2 ++;
        }
        for (var i = 1; i < N; i++){
            if (vec_a[i] %  Math.pow(2, howManyDividedBy2) !== 0) return 0;
            if (vec_a[i] %  Math.pow(2, howManyDividedBy2 + 1) === 0) return 0;
            vec_a[i] /= Math.pow(2, howManyDividedBy2);
        }
        vec_a.sort((a, b) => a - b);

        var tmp = BigInt(vec_a[0]);
        for (var i = 1; i < N; i++){
            tmp = saishoKobai(tmp, BigInt(vec_a[i]));
            if (tmp  * BigInt(Math.pow(2, howManyDividedBy2 - 1))> BigInt(M)) return 0;
        }

        var increment = Number(tmp) * Math.pow(2, howManyDividedBy2);
        var first = Number(tmp) * Math.pow(2, howManyDividedBy2 - 1);        
        
    } else {
        var increment = vec_a[0];
        var first = vec_a[0] / 2;
    }
    return (((M - first) / increment | 0) + 1);
}

function saishoKobai(x, y){
    if (x < y) [x, y] = [y, x];
    var tmp1 = x;
    var tmp2 = y;
    while (tmp2 != 0){
        [tmp1, tmp2] = [tmp2, tmp1 % tmp2];
    }
    return (BigInt(x) * BigInt(y) / BigInt(tmp1));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8")); 