#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000 long long S; void get(vector a,vector &t,int c,long long s){ if(a.size()==c){ t.push_back(s); return; } long long tt = 1; rep(i,30){ if(s+tt>S)break; if(i!=0)get(a,t,c+1,s+tt); tt *= a[c]; } } int main(){ int n; cin>>n; cin>>S; vector a(n); rep(i,n)cin>>a[i]; vector b; while(a.size()>b.size()){ b.push_back(a.back()); a.pop_back(); } vector x,y; get(a,x,0,0); get(b,y,0,0); sort(x.begin(),x.end()); long long ans = 0; rep(i,y.size()){ ans += distance(x.begin(),lower_bound(x.begin(),x.end(),S-y[i]+1)); } cout<