var
	N,S,i,j,A,ans:Longint;
	dp:Array[0..3001]of Longint;
begin
	read(N,S);
	for i:=1 to N do begin
		dp[S]:=i;
		read(A);
		for j:=A to S do begin
			inc(dp[j-A],dp[j]);
			if dp[j-A]>=998244353 then dec(dp[j-A],998244353);
		end;
		inc(ans,dp[0]);
		if ans>=98244353 then dec(ans,998244353);
	end;
	writeln(ans);
end.
