#ifdef Rahul
#include "RAHUL.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define error(...) 42;
#endif
#define SZ(v) int((v).size())
#define ALL(vec) begin(vec), end(vec)
typedef long long i64;
template<typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template<typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}
template<typename T> void kek(T ans) {cout << ans << endl; exit(0);}
#define Luv(...) [&] (auto &&u, auto &&v) { return __VA_ARGS__; }
const int MOD = (int) 1e9 + 7;
const i64 INF = (i64) 1e18 + 42;

const int N = 52;
int n;
i64 a[N];
i64 b[N];
i64 d[N];

i64 dp[N][2];

i64 Solve(int i, int carry) {
  if (i == n) return 1;
  i64 &res = dp[i][carry];
  if (~res) return res;
  if (carry && d[i] == b[i] - 1) return res = Solve(i + 1, 1);
  if (!carry && d[i] == 0) return res = Solve(i + 1, 0);
  return res = Solve(i + 1, 0) + Solve(i + 1, 1);
}

int main() {
  cin.tie(nullptr) -> sync_with_stdio(false);
  
  memset(dp, -1, sizeof dp);
  i64 x; cin >> n >> x;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (i > 1) b[i - 1] = a[i] / a[i - 1];
  }
  for (int i = n; i > 0; --i) {
    d[i] = x / a[i];
    x %= a[i];
  }
  kek(Solve(0, 0));
}
#include <bits/stdc++.h>
//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using ld = long double;
using vld = vector<ld>;
using vb = vector<bool>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define dbg(x) true
#endif

template <class T> bool chmin(T& a, T b) {
    if(a > b) { a = b; return true; }
    else return false;
}

template <class T> bool chmax(T& a, T b) {
    if(a < b) { a = b; return true; }
    else return false;
}

template <class T> ostream& operator<<(ostream& s, const vector<T>& a) {
    for(auto i : a) s << i << ' ';
    return s;
}

constexpr int INF = 1 << 30;
constexpr ll INFL = 1LL << 62;
constexpr ld EPS = 1e-12;
ld PI = acos(-1.0);

void solve() {
    ll n, x;
    cin >> n >> x;
    vll a(n);
    rep(i, n) cin >> a[i];
    vll div(n-1);
    rep(i, n-1) div[i] = a[i+1]/a[i];
    div.push_back(INFL);
    vll cnt(n); // お釣りのない場合の各コインの枚数
    for(int i = n-1; i >= 0; --i) {
        cnt[i] = x / a[i];
        x -= cnt[i] * a[i];
    }

    vvll dp(n+1, vll(2));   // dp[i][j] : i枚目のコイン,jは桁上がりの有無
    dp[0][0] = 1;
    rep(i, n) {
        dp[i+1][0] += dp[i][0]; // 桁上がり無しの支払い
        dp[i+1][1] += dp[i][1]; // 桁上がり有りの遷移
        if(cnt[i] > 0) {    // 支払いに1枚以上必要な時は桁上がりへの遷移がある
            dp[i+1][1] += dp[i][0];
        }
        if(cnt[i]+1 < div[i]) { // 桁上がり後に桁上がり無しに遷移できる
            dp[i+1][0] += dp[i][1];
        }
    }
    cout << dp[n][0] << endl;
    return;
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}