#include <bits/stdc++.h>
using namespace std;
inline int readint() {
  int a = 0;
  char c = getchar(), f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -f;
  for (; '0' <= c && c <= '9'; c = getchar())
    a = (a << 3) + (a << 1) + (c ^ 48);
  return a * f;
}
template <class T>
void getMax(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
void getMin(T& a, T b) {
  if (b < a) a = b;
}
const int MaxN = 3005;
const int Mod = 998244353;
int dp[MaxN][MaxN];
char s[MaxN], t[MaxN];
int main() {
  scanf("%s %s", s + 1, t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  for (int i = 1; i <= n + 1; ++i) dp[i][i - 1] = 1;
  for (int j = 0; j < n; ++j)
    for (int i = 1; i + j <= n; ++i) {
      if (m < i || s[j + 1] == t[i]) dp[i][i + j] += dp[i + 1][i + j];
      if (m < i + j || s[j + 1] == t[i + j]) dp[i][i + j] += dp[i][i + j - 1];
      dp[i][i + j] %= Mod;
    }
  int ans = 0;
  for (int i = m; i <= n; ++i) ans = (ans + dp[1][i]) % Mod;
  printf("%d\n", ans);
  return 0;
}
