#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const ll INF = 1e18;

ll dp[55][2];

int main(){
  int n; cin >> n;
  ll X; cin >> X;
  vector<ll> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  vector<ll> x(n);
  for(int i = n-1; i>=0; i--){
    x[i] = X / a[i];
    X %= a[i];
  }
  dp[0][0] = 1;
  vector<ll> t(n);
  for(int i = 0; i < n-1; i++) t[i] = a[i+1]/a[i];
  t[n-1] = INF;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < 2; j++){
      for(int nj = 0; nj < 2; nj++){
        //x[i]+z[i]+j=y+nj*t[i], y=0
        ll z = nj*t[i]-x[i]-j;
        if(z>=0 && z<t[i]) dp[i+1][nj] += dp[i][j];
        //x[i]+z[i]+j=y+nj*t[i], z=0
        ll y = x[i]+j-nj*t[i];
        if(y>0 && y<t[i]) dp[i+1][nj] += dp[i][j];
      }
    }
  }
  cout << dp[n][0] << endl;
  return 0;
}
  
#include<iostream>
#include<vector>
using namespace std;
int main() {
  long long N,x;
  cin >> N >> x;
  vector<long long> A(N);
  int i;
  for(i=0;i<N;i++)cin >> A[i];
  for(i=N-1;i>0;i--)A[i] /= A[i-1];
  vector<long long> X(N,0);
  X[0] = x;
  for(i=1;i<N;i++) {
    X[i] = X[i-1]/A[i];
    X[i-1] %= A[i];
  }
  long long yes = 1,no = 0,temp;
  for(i=0;i<N;i++) {
    if(i<N-1?X[i] == A[i+1]-1:false)temp = yes;
    else temp = yes + no;
    if(X[i] != 0)no = yes + no;
    yes = temp;
  }
  cout << yes << endl;
}