#include <bits/stdc++.h>

int n;
long long x;
long long a[100];
long long b[100];
long long dp[100][2]; 
// dp[i]最低i位的方案数字
// dp[i][0]: 不借位的方案数
// dp[i][1]: 借位的方案数

int main() {
  scanf("%d%lld", &n, &x);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
  }
  long long tmp = x;
  for (int i = n; i >= 1; --i) {
    if (i == n) {
      b[i] = tmp / a[i];
    } else {
      b[i] = std::min(tmp / a[i], a[i + 1] / a[i] - 1);
    }
    tmp = tmp - b[i] * a[i];
    // printf("%lld,", b[i]);
  }
  assert(tmp == 0);
  // printf("\n");

  // 不被借位
  if (b[1] == 0) {
    dp[1][0] = 1;
  } else {
    dp[1][0] = 1;
    dp[1][1] = 1;
  }
  // printf("%d: %lld %lld\n", 1, dp[1][0], dp[1][1]);

  for (int i = 2; i < n; ++i) {
    if (!b[i]) {
      dp[i][0] += dp[i - 1][0];
      dp[i][1] += 0ll;

      dp[i][0] += dp[i - 1][1];
      dp[i][1] += dp[i - 1][1];
    } else {
      dp[i][0] += dp[i - 1][0];
      dp[i][1] += dp[i - 1][0];

      if (b[i] + 1 < a[i + 1] / a[i]) {
        dp[i][0] += dp[i - 1][1];
      }
      dp[i][1] += dp[i - 1][1];
    }
    // printf("%d: %lld %lld\n", i, dp[i][0], dp[i][1]);
  }
  if (n == 1) {
    printf("1\n");
  } else {
    printf("%lld\n", dp[n - 1][0] + dp[n - 1][1]);
  }
  return 0;
}
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N;
    int x = 0;
    vector<int> A;
    vector<int> X;
    vector<vector<int>> dp;
    
    cin>>N>>x;
    
    A.resize(N);
    X.resize(N);
    dp.resize(N+1, vector<int>(2));
	
    for(int i = 0; i < N; i++){
        cin>>A[i];
    }
    
    for(int i = N-1; i >= 0; i--){
        X[i] = x/A[i];
        x %= A[i];
        // cout<<"X = "<<X[i]<<endl;
    }
    
    dp[0][0] = 1;
    
    for(int i = 0; i < N; i++){
        if(X[i] == 0) {
            dp[i+1][0] += dp[i][0];
            dp[i+1][0] += dp[i][1];
            dp[i+1][1] += dp[i][1];
        } else if(i + 1 != N && X[i] == A[i+1]/A[i] - 1) {
            
            dp[i+1][0] += dp[i][0];
            
            dp[i+1][1] += dp[i][0];
            dp[i+1][1] += dp[i][1];
        } else {
            dp[i+1][0] += dp[i][0];
            dp[i+1][1] += dp[i][0];
            
            dp[i+1][0] += dp[i][1];
            dp[i+1][1] += dp[i][1];
        }
        // cout<<"i = "<<i<<endl;
        // cout<<dp[i][0]<<endl;
        // cout<<dp[i][1]<<endl;
        // cout<<endl;
    }
	
    // cout<<dp[N][0]<<endl;
    // cout<<dp[N][1]<<endl;
    cout<<dp[N-1][0] + dp[N-1][1]<<endl;
	return 0;
}