#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 10;
const int mod = 998244353;
char s[N], t[N];
int dp[N][N];
int main() {
  scanf("%s %s", s + 1, t + 1);
  int slen = strlen(s + 1);
  int tlen = strlen(t + 1);
  for (int i = 1; i <= tlen; i++) dp[i][i] = 2 * (t[i] == s[1]);
  for (int i = tlen + 1; i <= slen; i++) dp[i][i] = 2, t[i] = '?';
  for (int i = 2; i <= slen; i++) {
    for (int j = 1; j <= slen; j++) {
      int r = j + i - 2;
      if (r > slen) continue;
      if (j - 1 >= 1 && (t[j - 1] == s[i] || t[j - 1] == '?'))
        dp[j - 1][r] = (dp[j - 1][r] + dp[j][r]) % mod;
      if (r + 1 <= slen && (t[r + 1] == s[i] || t[r + 1] == '?'))
        dp[j][r + 1] = (dp[j][r + 1] + dp[j][r]) % mod;
    }
  }
  int ans = 0;
  for (int i = tlen; i <= slen; i++) ans = (ans + dp[1][i]) % mod;
  printf("%d", ans);
}
