#include <bits/stdc++.h>

void check_and_add(std::map< long long, long long >& mp, long long num, long long add){
    auto itr = mp.find(num);
    if(itr == mp.end()){
        mp[num] = add;
    }else{
        mp[num] += add;
    }
}

int main(){
    int N;
    long long X;
    std::cin >> N >> X;
    std::vector< long long > A(N);
    for(int i=0; i<N; i++){
        std::cin >> A[i];
    }
    
    std::vector< std::map< long long, long long > > dp(N);
    dp[N-1][X % A[N-1]] = 1;
    dp[N-1][X % A[N-1] - A[N-1]] = 1;
    
    for(int i=N-2; i>=0; i--){
        for(auto itr=dp[i+1].begin(); itr!=dp[i+1].end(); itr++){
            if(std::abs(itr->first) >= A[i+1]){
                continue;
            }
            if(itr->first == 0){
                check_and_add(dp[i], 0, itr->second);
            }else if(itr->first > 0){
                long long money = itr->first % A[i];
                check_and_add(dp[i], money, itr->second);
                
                if(money != 0){
                    money -= A[i];
                    if(itr->first - money < A[i+1]){
                        check_and_add(dp[i], money, itr->second);
                    }
                }
            }else{
                long long money = itr->first % A[i];
                check_and_add(dp[i], money, itr->second);
                
                if(money != 0){
                    money += A[i];
                    if(-1 * itr->first + money < A[i+1]){
                        check_and_add(dp[i], money, itr->second);
                    }
                }
            }
        }
    }
    
    
    std::cout << dp[0][0] << std::endl;
    
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define int long long

int n;

map<pair<int, int>, int> ans;

int solve(vector<int> & a, int x, int st)
{
    if (ans[{x, st}])
    {
        return ans[{x, st}];
    }
    if (st == n - 1)
    {
        return 1;
    }
    if (x % (a[st + 1] / a[st]) == 0)
    {
        int k = (a[st + 1] / a[st]);
        int res = solve(a, x / k, st + 1);
        ans[{x, st}] = res;
        return res;
    }
    int k = (a[st + 1] / a[st]);
    int res = solve(a, x / k, st + 1) + solve(a, x / k + 1, st + 1);
    ans[{x, st}] = res;
    return res;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); srand(clock());
    int x;
    cin >> n >> x;
    vector<int> a(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    cout << solve(a, x, 0) << endl;
    return 0;
}
