import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

immutable int mod = 998_244_353;

void main ()
{
	string s;
	while ((s = readln.strip ()) != "")
	{
		auto t = readln.strip;
		auto n = s.length.to !(int);
		auto m = t.length.to !(int);
		auto f = new int [] [] (n + 1, n + 1);
		foreach (i; 0..n + 1)
		{
			f[i][i] = 1;
		}
		foreach (len; 0..n)
		{
			auto letter = s[len];
			foreach (start; 0..n + 1 - len)
			{
				auto finish = start + len;
				auto cur = f[start][finish];
				if (start > 0 &&
				    (start - 1 >= m || letter == t[start - 1]))
				{
					f[start - 1][finish] += cur;
					if (f[start - 1][finish] >= mod)
					{
						f[start - 1][finish] -= mod;
					}
				}
				if (finish < n &&
				    (finish >= m || letter == t[finish]))
				{
					f[start][finish + 1] += cur;
					if (f[start][finish + 1] >= mod)
					{
						f[start][finish + 1] -= mod;
					}
				}
			}
		}
		writeln (sum (f[0][m..$], 0L) % mod);
	}
}
