#include <bits/stdc++.h>
using namespace std;
const int maxn = 3005;
const int mod = 998244353;
char s[maxn];
char t[maxn];
int dp[maxn][maxn];
int main(void) {
  scanf("%s%s", s + 1, t + 1);
  int ns = strlen(s + 1);
  int nt = strlen(t + 1);
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= nt; i++)
    if (s[1] == t[i]) dp[i][i] = 2;
  for (int i = nt + 1; i <= ns; i++) dp[i][i] = 2;
  for (int len = 2; len <= ns; len++) {
    for (int i = 1; i + len - 1 <= ns; i++) {
      int j = i + len - 1;
      if (i > nt || s[len] == t[i]) dp[i][j] = (dp[i][j] + dp[i + 1][j]) % mod;
      if (j > nt || s[len] == t[j]) dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
    }
  }
  int res = 0;
  for (int i = nt; i <= ns; i++) res = (res + dp[1][i]) % mod;
  printf("%d\n", res);
  return 0;
}
