#include <bits/stdc++.h>
using namespace std;
int inline read() {
  int num = 0, neg = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num * neg;
}
const int maxn = 3010, mod = 998244353;
char s[maxn], t[maxn];
int n, m, f[maxn][maxn];
int calc(int x, int y) { return (y <= m) ? (s[x] == t[y]) : 1; }
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  scanf("%s", t + 1);
  m = strlen(t + 1);
  int ans;
  for (int i = 1; i <= n; i++) {
    f[i][i] = calc(1, i);
    if (i == 1) ans = (m == 1) ? f[i][i] : 0;
  }
  for (int i = 2; i <= n; i++) {
    int l = 1, r = i - 1;
    while (r <= n) {
      if (l && calc(i, l - 1)) f[l - 1][r] = (f[l - 1][r] + f[l][r]) % mod;
      if (r < n && calc(i, r + 1)) f[l][r + 1] = (f[l][r + 1] + f[l][r]) % mod;
      l++;
      r++;
    }
    if (i >= m) ans = (ans + f[1][i]) % mod;
  }
  ans = ans * 2 % mod;
  printf("%d", ans);
  return 0;
}
