#include <bits/stdc++.h>
using namespace std;
int N, M;
string s, t;
long long dp[3005][3005];
int main() {
  cin >> s >> t;
  N = s.length();
  M = t.length();
  s = "$" + s;
  t = "^" + t;
  if (N == 1) {
    if (s[1] == t[1])
      cout << "2" << endl;
    else
      cout << "0" << endl;
    return 0;
  }
  for (int i = 1; i <= N; i++) {
    if (i <= M && s[1] == t[i]) dp[i][i] = 2;
    if (i > M) dp[i][i] = 2;
  }
  long long ans = 0;
  for (int len = 2; len <= N; len++) {
    for (int l = 1; l <= N; l++) {
      int r = l + len - 1;
      if (l > M || s[len] == t[l])
        dp[l][r] = (dp[l][r] + dp[l + 1][r]) % int(998244353);
      if (r > M || s[len] == t[r])
        dp[l][r] = (dp[l][r] + dp[l][r - 1]) % int(998244353);
    }
    if (len >= M) ans = (ans + dp[1][len]) % int(998244353);
  }
  cout << ans << endl;
  return 0;
}
