#include <bits/stdc++.h>
const int maxn = 3e3 + 3;
const long long mo = 998244353;
int n, m;
char s[maxn], t[maxn];
long long dp[maxn][maxn];
int main() {
  scanf("%s%s", s, t);
  n = strlen(s);
  m = strlen(t);
  for (int i = 0; i < n; ++i) {
    for (int l = 0; l + i < n; ++l) {
      int r = l + i;
      if (!i) {
        if (l >= m || s[i] == t[l]) {
          dp[l][r] = 2;
        }
      } else {
        if (l >= m || s[i] == t[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mo;
        if (r >= m || s[i] == t[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mo;
      }
    }
  }
  long long ans = 0;
  for (int i = m - 1; i < n; ++i) ans = (ans + dp[0][i]) % mo;
  printf("%lld\n", ans);
  return 0;
}
