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

int n;
long long num;
long long a[55], b[55];

long long dp[55][2];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> num;

    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }

    a[0] = 1;
    for (int i = n; i >= 1; i--) {
        b[i] = num / a[i];
        num %= a[i];

        if (b[i] == 0) b[i] = 0;
        else if (b[i] != a[i + 1] / a[i] - 1) b[i] = 2;
        else b[i] = 1;
    }

    dp[0][0] = 1;
    dp[0][1] = 0;

    for (int i = 1; i < n; i++) {
        if (b[i] == 0) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][1];
        } else if (b[i] == 1) {
            dp[i][0] = dp[i - 1][0];
            dp[i][1] = dp[i - 1][0] + dp[i - 1][1];
        } else {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0] + dp[i - 1][1];
        }
    }

    cout << dp[n - 1][0] + dp[n - 1][1] << "\n";

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(ll i=1;i<=(ll)(n);i++)


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n,x;
  cin >> n >> x;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  ll dp[2];
  dp[0] = 1;
  dp[1] = 0;
  ll tx = x;
  rep(i,n-1){
    ll amari = tx%a[i];//前の＋
    ll amari_minus = amari - a[i];//前の-

    ll amari_now = tx%a[i+1];
    ll amari_now_minus = amari_now - a[i+1];
    // cout << amari <<" " << amari_minus << " " << amari_now << " " << amari_now_minus << endl;
    ll ndp[2];
    if(abs(amari-amari_now)<=a[i+1]-a[i]){
      //dp[0]そのまま
      ndp[0] = dp[0];
    }
    else{
      ndp[0] = 0;
    }
    if(abs(amari_minus-amari_now_minus)<=a[i+1]-a[i]){
      ndp[1] = dp[1];
    }
    else ndp[1] = 0;
    if(abs(amari_minus-amari_now)<=a[i+1]-a[i]) ndp[0] += dp[1];
    if(abs(amari-amari_now_minus)<=a[i+1]-a[i]) ndp[1] += dp[0];
    dp[0]= ndp[0];
    dp[1]= ndp[1];
    // cout << dp[0] <<" " << dp[1] << endl;
  }
  cout << dp[0] + dp[1] << endl;

  return 0;
    

}
