#include <bits/stdc++.h>
char s[3010], t[3010];
long long dp[3010][3010];
int main() {
  scanf("%s %s", s + 1, t + 1);
  int cnts = strlen(s + 1);
  int cntt = strlen(t + 1);
  for (int i = 1; i <= cnts + 1; i++) {
    dp[i][i - 1] = 1;
  }
  for (int i = 1; i <= cnts; i++) {
    for (int j = 1; j + i - 1 <= cnts; j++) {
      int l = j, r = i + j - 1;
      if (l > cntt || s[i] == t[l]) {
        dp[l][r] = (dp[l][r] + dp[l + 1][r]) % 998244353;
      }
      if (r > cntt || s[i] == t[r]) {
        dp[l][r] = (dp[l][r] + dp[l][r - 1]) % 998244353;
      }
    }
  }
  long long ans = 0;
  for (int i = cntt; i <= cnts; i++) {
    ans = (ans + dp[1][i]) % 998244353;
  }
  printf("%lld\n", ans);
}
