#include <bits/stdc++.h>

using ll = long long int;
using P = std::pair<int, int>;

#define rep(i, n) for (int i = 1; i <= (n); ++i)
#define rag(con) std::begin(con), std::end(con)

int main()
{
    int n;
    ll x;
    std::cin >> n >> x;

    std::vector<ll> a(n + 1), b(n + 1), c(n);
    std::vector<std::vector<ll>> d(n + 1, std::vector<ll>(2));

    rep(i, n)
            std::cin >>
        a[i];

    for (int i = n; i >= 1; --i)
    {
        b[i] = x / a[i];
        x = x % a[i];
        //std::cerr << b[i];
    }
    //std::cerr << std::endl;

    for (int i = 1; i < n; ++i)
        c[i] = a[i + 1] / a[i];

    d[1][0] = 1;
    if (b[1] > 0)
        d[1][1] = 1;

    for (int i = 2; i <= n; ++i)
    {
        d[i][0] = d[i - 1][0];
        if (b[i] != c[i] - 1)
            d[i][0] += d[i - 1][1];
        d[i][1] = d[i - 1][1];
        if (b[i] > 0)
            d[i][1] += d[i - 1][0];
        //std::cerr << d[i][0] << ' ' << d[i][1] << std::endl;
    }

    std::cout << d[n][0] << std::endl;

    return 0;
}
#include<bits/stdc++.h>
#define int long long
#define HgS 998244353
using namespace std;
char ch[510][510];
char dep[1510];
long long ksm(int x)
{
    long long a=2;
    long long ans=1;
    while(x)
    {
        if(x&1)ans=ans*a%HgS;
        a=a*a%HgS;x>>=1;
    }
    return ans;
}
signed main(){
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n,m;
    bool Noans=0;
    cin>>n>>m;
    for(int i=2;i<=n+m;++i)dep[i]='.';
    for(int i=1;i<=n;++i)
    {
        for(int j=1;j<=m;++j)
        {
            cin>>ch[i][j];
            if(ch[i][j]=='.')continue;
           // cout<<i<<' '<<j<<'\n';
            if(dep[j+i]=='.')
            dep[j+i]=ch[i][j];
            else if(dep[j+i]!=ch[i][j])Noans=1;
        }
    }
    if(Noans)
    {
        cout<<0;
        return 0;
    }
    int ans=0;
    for(int i=2;i<=n+m;++i)
    {
        if(dep[i]=='.')ans++;
    }
   // cout<<ans<<'\n';
    cout<<ksm(ans)<<'\n';
    return 0;
}