#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz(v) int((v).size())
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define int ll
template<typename A,typename B>
string to_string(pair<A,B>p){return"("+to_string(p.first)+", "+to_string(p.second)+")";}
template<typename A,typename B,typename C>
string to_string(tuple<A,B,C>p){return"("+to_string(get<0>(p))+", "+to_string(get<1>(p))+", "+to_string(get<2>(p))+")";}
template<typename A,typename B,typename C,typename D>
string to_string(tuple<A,B,C,D>p){return"("+to_string(get<0>(p))+", "+to_string(get<1>(p))+", "+to_string(get<2>(p))+", "+to_string(get<3>(p))+")";}
string to_string(const string &s){return'"'+s+'"';}
string to_string(const char *s){return to_string((string)s);}
string to_string(bool b){return(b?"true":"false");}
string to_string(vector<bool>v){int f=0;string r="{";for(bool i:v)r+=(f++?",":"")+to_string(i);r+="}";return r;}
template<size_t N>
string to_string(bitset<N>v){string res="";for(size_t i=0;i<N;res+=char('0'+v[i++]));return res;}
template<typename A>
string to_string(A v){int f=0;string r="{";for(auto&i:v)r+=(f++?",":"")+to_string(i);r+="}";return r;}
void debug_out(){cerr<<']'<<endl;}
template<typename Head,typename...Tail>
void debug_out(Head H,Tail...T){cerr<<to_string(H);if(sizeof...(T))cerr<<", ";debug_out(T...);}
#ifdef LOCAL
#define debug(x...) cerr << "[" << (#x) << "] = [", debug_out(x)
#else
#define debug(x...) 33
#endif
const int mod = 998244353;
const int N = 51;
typedef array<array<int, N>, N> mat;
mat operator * (const mat& a, const mat& b)
{
    mat c;
    forn(i, N) forn(j, N) c[i][j] = 0;
    forn(i, N) forn(j, N) forn(k, N)
        c[i][j] = (c[i][j] + a[i][k] * b[k][j])%mod;
    return c;
}
mat power(mat a, int b)
{
    mat res;
    forn(i, N) forn(j, N) res[i][j] = (i == j);
    for(;b;b>>=1,a=a*a)
        if (b&1) res = res * a;
    return res;
}
int f(const vector<int>& a)
{
    int n = a.size();
    vector<pair<int, int>> segs;
    int x = 0;
    forn(i, n)
    {
        segs.push_back({x + (a[i] < 0 ? -1 : 1), x + a[i]});// 포함구간
        x += a[i];
    }
    segs[0].first = 0;//ok
    vector<int> qs;
    for (auto& it: segs)
    {
        for (int z = -1;z<=1;++z)// maybe just all check?
        {
            qs.push_back(it.first + z);
            qs.push_back(it.second + z);
        }
    }
    sort(all(qs));
    qs.resize(unique(all(qs))-qs.begin());
    qs.pop_back();//why? maybe just delete over the range (last peak + 1)
    debug(qs);
    vector<int> ans(n + 1);
    ans[0] = 1;
    int lst = -1;
    for (auto x: qs)
    {
        mat cur{};
        forn(i, n) if (min(segs[i].first, segs[i].second)<=lst + 1 && x <= max(segs[i].first, segs[i].second))
        {
            if (segs[i].first < segs[i].second)
                forn(j, i + 2) cur[j][i + 1] = 1;
            else
                forn(j, i + 1) cur[j][i + 1] = 1;
        }
        cur = power(cur, x - lst);
        vector<int> nxt_ans(n + 1);
        forn(i, n + 1) forn(j, n + 1)
            nxt_ans[j] = (nxt_ans[j] + ans[i] * cur[i][j]%mod)%mod;
        ans = nxt_ans;
        lst = x;
    }
    int sum = 0;
    forn(i, n + 1) sum = (sum + ans[i])%mod;
    return sum;
}
signed main(void)
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n; cin>>n;
    int x; cin>>x;
    vector<int> a;
    forn(i, n)
    {
        int t; cin>>t;
        if (t) a.push_back(t);
    }
    n = sz(a);
    int mx = 0;
    forn(i, n)
    {
        int cur = 0;
        for (int j=i; j<n;++j)
        {
            cur += a[j];
            mx = max(mx, cur);
        }
    }
    if (mx == 0) // LLIS = 1, yes
    {
        int sum = 1;
        forn(i, n) sum = ( (sum - a[i])%mod + mod)%mod;
        cout << 1 << ' ' <<sum << '\n';
        return 0;
    }
    vector<pair<int, int>> bst;
    forn(i, n)
    {
        int cur = 0;
        int r = -1;
        for (int j = i; j < n;++j)
        {
            cur += a[j];
            if (mx == cur) r = j;
        }
        if (r!=-1)
        {
            bst.push_back({i, r});
            i = r;
        }
    }
    debug(bst);
    int sum = 0;
    for(auto& it: bst) sum = (sum + f(  vector<int>(a.begin() + it.first, a.begin()+it.second + 1) )   )%mod;
    cout << mx + 1 << ' ' <<sum << '\n';
    return 0;
}