#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5, mod = 998244353;
int T, nr, ng, nb, tr, tg, tb;
int r[N], g[N], b[N];
char s[N], t[N];
long long dp[N][N];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  for (int j = 1; j <= n + 1; j++) dp[0][j] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n - i + 1; j++) {
      if (s[i] == t[j + i - 1] || j + i - 1 > m)
        dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
      if (s[i] == t[j] || j > m) dp[i][j] = (dp[i][j] + dp[i - 1][j + 1]) % mod;
    }
  }
  long long ans = 0;
  for (int i = m; i <= n; i++) ans = (ans + dp[i][1]) % mod;
  printf("%lld", ans);
  return 0;
}
