#include <bits/stdc++.h>
using namespace std;
const int N = 3000 + 77, Mod = 998244353;
int n, m, A, dp[N][N];
char S[N], T[N];
inline void fix(int& x) {
  if (x >= Mod) x -= Mod;
}
int main() {
  scanf("%s", S + 1);
  scanf("%s", T + 1);
  n = strlen(S + 1);
  m = strlen(T + 1);
  dp[n + 1][0] = 1;
  for (int i = n; i > 0; --i)
    for (int j = 0; j + i - 1 <= n; ++j) {
      if (j > m || (T[j] == S[i] && j > 0)) {
        if (j == 1)
          fix(dp[i][j] +=
              dp[i + 1][j - 1] * 1ll * min((n + 1 - i), n - m + 1) % Mod);
        else
          fix(dp[i][j] += dp[i + 1][j - 1]);
      }
      int c = j + i;
      if (c > m || T[c] == S[i]) fix(dp[i][j] += dp[i + 1][j]);
    }
  for (int i = 0; i <= n; ++i) fix(A += dp[1][i]);
  printf("%d\n", A);
  return 0;
}
