#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define Pii pair<int,int>
#define Pll pair<long long,long long>
#define fout(num) cout << fixed << setprecision(20) << (num) << endl
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//vector<vector<ll>> dp(n,vector<ll>(n))
//2-dim:vector<vector<Type>> vv(n, vector<Type>(m, d));
//3-dim:vector<vector<vector<Type>>> vvv(n, vector<vector<Type>>(m, vector<Type>(l, d)));

using namespace std;
vector<ll> a;
int n;
ll x;
map<Pll,ll> memo;
ll dfs(ll val,int k){
    Pll p=make_pair(val,k);
    if(memo.count(p)) return memo[p];
    if(k==n-1){
        return 1;
    }
    if(val%a[k+1]==0){
        return memo[p]=dfs(val,k+1);
    }else{
        val-=val%a[k+1];
        return memo[p]=dfs(val,k+1)+dfs(val+a[k+1],k+1);
    }
}
signed main(){
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cin >> n >> x;
    a.resize(n);
    rep(i,n){
        cin >> a[i];
    }
    cout << dfs(x,0) << endl;
}
// g++ main.cpp -o main.out && ./main.out 

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define rept(i,t,n) for(int64_t i = (int64_t)(t);i < (int64_t)(n);i++)
#define all(vec) vec.begin(), vec.end()
int main(){
  int64_t n;
  int64_t c,m = 0;
  cin >> n;
  int64_t t = n+1;
  rept(i,1,n+2){
    c += i;
    if(c > n+1){
      m = i-1;
      break;
    }
    else if(c == n+1){
      m = i;
      break;
    }
  }
  cout << n+1-m;
}