#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define ll long long int
#define mod 998244353
inline int sum(int a,int b){return a+b<mod?a+b:a+b-mod;}
inline int mul(int a,int b){return (int)((ll)a*b%mod);}
inline int pow(int a,int b)
{
	int res=1;
	while(b>0){
		if(b&1) res=mul(res,a);
		a=mul(a,a); b>>=1;
	}
	return res;
}
inline int inv(int x){return pow(x,mod-2);}

int n,m=0,t,ans=0;
ll l[50],r[50],pos[150];
struct matrix{
	int m[50][50];
	matrix(void){
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++)
				m[i][j]=m[j][i]=0;
			m[i][i]=1;
		}
		return;
	}
};
matrix mmul(matrix m1,matrix m2)
{
	matrix M;
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++){
			M.m[i][j]=0;
			for(int k=0;k<n;k++)
				M.m[i][j]=sum(M.m[i][j],mul(m1.m[i][k],m2.m[k][j]));
		}
	return M;
}
matrix mpow(matrix m,ll k)
{
	matrix M;
	while(k>0){
		if(k&1) M=mmul(M,m);
		m=mmul(m,m); k>>=1;
	}
	return M;
}

namespace solver
{
	int n,m;
	ll p[50],q[50];
	void prepare(int L,int R)
	{
		n=R-L+1; m=0;
		for(int i=0;i<n;i++){
			p[i]=l[i+L];
			q[i]=r[i+L];
		}
		bool opt=0;
		for(int i=0;i<n;i++){
			if(p[i]==q[i]){
				p[i]=q[i]=1e18;
				continue;
			}
			if(opt&&p[i]<=q[i]){
				p[i]++;
				if(i<n-1) q[i]--;
				if(p[i]>q[i]) p[i]=q[i]=1e18;
			}
			else if(opt&&p[i]>q[i]){
				p[i]--; q[i]++;
				if(p[i]<q[i]) p[i]=q[i]=1e18;
			}
			if(p[i]<1e18){
				pos[m++]=p[i]; pos[m++]=q[i];
			}
			opt^=1;
		}
		sort(pos,pos+m);
		return;
	}
	
	inline bool check(int a,ll k)
	{
		return (p[a]<=k&&k<=q[a])||(p[a]>=k&&k>=q[a]);
	}
	int res[50],temp[50];
	inline void update(ll& nowk)
	{
		for(int x=0;x<n;x++){
			temp[x]=0;
			for(int y=0;y<x;y++)
				if(check(y,nowk))
					temp[x]=sum(temp[x],res[y]);
			if(p[x]<=nowk&&nowk<=q[x])
				temp[x]=sum(temp[x],res[x]);
		}
		nowk++;
		for(int x=0;x<n;x++)
			if(!check(x,nowk))
				temp[x]=0;
		for(int x=0;x<n;x++)
			res[x]=temp[x];
		return;
	}
	
	int solve(int L,int R)
	{
		prepare(L,R);
		ll nowk=pos[0];
		for(int i=0;i<n;i++)
			if(check(i,nowk))
				res[i]=1;
			else res[i]=0;
		for(int i=0;i<m;i++){
			if(nowk<pos[i])
				update(nowk);
			if(i<m-1){
				if(nowk==pos[i]&&nowk<pos[m-1])
					update(nowk);
				matrix m1;
				for(int x=0;x<n;x++){
					for(int y=x+1;y<n;y++)
						if(check(x,nowk)&&check(y,nowk))
							m1.m[x][y]=1;
					if(p[x]>nowk||nowk>q[x])
						m1.m[x][x]=0;
				}
				ll k=pos[i+1]-1-nowk;
				matrix m2=mpow(m1,k);
				for(int x=0;x<n;x++){
					temp[x]=0;
					for(int y=0;y<n;y++)
						temp[x]=sum(temp[x],mul(res[y],m2.m[y][x]));
				}
				for(int x=0;x<n;x++)
					res[x]=temp[x];
				nowk=max(nowk,pos[i+1]-1);
			}
		}
		int ans=0;
		for(int i=0;i<n;i++)
			if(p[i]==pos[m-1]||q[i]==pos[m-1])
				ans=sum(ans,res[i]);
		return ans;
	}
}

bool checkup(void)
{
	for(int i=0;i<n;i++)
		if(l[i]<r[i])
			return 0;
	return 1;
}
int main(void)
{
	scanf("%d%lld",&n,&l[0]);
	for(int i=0;i<n;i++){
		scanf("%d",&t);
		r[i]=l[i]+t;
		if(i!=n-1) l[i+1]=r[i];
	}
	if(checkup()){
		printf("1 %lld\n",(l[0]-r[n-1]+1)%mod);
		return 0;
	}
	int d=0,ans2=0;
	ll ans1=0;
	while(d<n){
		int mx=d,mn=d;
		for(int i=d;i<n;i++)
			if(r[mx]<=r[i])
				mx=i;
		for(int i=d;i<=mx;i++)
			if(l[mn]>l[i])
				mn=i;
		if(ans1<r[mx]-l[mn]+1)
			ans2=0;
		if(ans1<=r[mx]-l[mn]+1){
			ans1=r[mx]-l[mn]+1;
			ans2=sum(ans2,solver::solve(mn,mx));
		}
		d=mx+1;
	}
	printf("%lld %d\n",ans1,ans2);
	return 0;
}
/*
9 0
4 -4 4 -4 4 -4 4 -1000000 1000
*/