#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma G++ optimize(2)
using namespace std;
const int MAX_N = 3e3 + 5;
const int mod = 998244353;
inline int add(int a, int b, const int mod) {
  return a + b >= mod ? a + b - mod : a + b;
}
int dp[MAX_N][MAX_N];
char s[MAX_N], t[MAX_N];
int main() {
  scanf("%s", s + 1), scanf("%s", t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  memset(dp, 0, sizeof(dp));
  for (register int i = 1; i <= m; ++i)
    if (s[1] == t[i]) dp[i][i] = 2;
  for (register int i = m + 1; i <= n; ++i) dp[i][i] = 2;
  for (register int i = 2; i <= n; ++i)
    for (register int l = 1; l <= n - i + 1; ++l) {
      int r = l + i - 1;
      if (l > m || s[i] == t[l]) dp[l][r] = add(dp[l][r], dp[l + 1][r], mod);
      if (r > m || s[i] == t[r]) dp[l][r] = add(dp[l][r], dp[l][r - 1], mod);
      ;
    }
  long long ans = 0;
  for (register int i = m; i <= n; ++i) ans = add(ans, dp[1][i], mod);
  printf("%lld\n", ans);
  return 0;
}
