#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 10;
int dp[N][N];
char s[N], t[N];
const int mod = 998244353;
int main() {
  scanf("%s%s", s + 1, t + 1);
  int ls = strlen(s + 1), lt = strlen(t + 1);
  for (int i = 1; i <= ls + 1; i++) dp[i][i - 1] = 1;
  for (int i = 1, len = 1; i <= ls; i++, len++) {
    for (int l = 1, r = l + len - 1; r <= ls; l++, r++) {
      if (l > lt || s[i] == t[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      if (r > lt || s[i] == t[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
    }
  }
  long long ans = 0;
  for (int i = lt; i <= ls; i++) ans = (ans + dp[1][i]) % mod;
  printf("%lld\n", ans);
  return 0;
}
