#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 60;
const double Inf = 1e20;
const double eps = 1e-9;
void gmax(int &a, int b) { a = (a > b ? a : b); }
void gmin(int &a, int b) { a = (a < b ? a : b); }
const int maxn = 3050;
const int P = 998244353;
int n, m, f[maxn][maxn];
char s[maxn], t[maxn];
void inc(int &x, int y) {
  x += y;
  if (x >= P) x -= P;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  scanf("%s", t + 1);
  m = strlen(t + 1);
  int ans = 0;
  for (int i = 1; i <= n + 1; ++i) f[0][i] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n + 1; ++j) {
      if (j > m || s[i] == t[j]) inc(f[i][j + 1], f[i - 1][j]);
      if (j > i && (j - i > m || s[i] == t[j - i])) inc(f[i][j], f[i - 1][j]);
    }
    if (i >= m) inc(ans, f[i][i + 1]);
  }
  printf("%d\n", ans);
  return 0;
}
