#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const int MOD = 998244353;
const int N = 3005;
char t[N];
string s1, s2;
int n, m, i, j, sum, res[N][N];
int get(int a, int b) {
  if (res[a][b] != -1) return res[a][b];
  if (a == n) return (b == 0);
  if (b == 0) {
    if (a >= m)
      res[a][b] = n - a + 1;
    else if (s1[a] == s2[a])
      res[a][b] = get(a + 1, b);
    else
      res[a][b] = 0;
  } else if (b == m) {
    if (s1[a] == s2[m - 1])
      res[a][b] = get(a + 1, b - 1);
    else
      res[a][b] = 0;
    res[a][b] = (2LL * get(a + 1, b) + res[a][b]) % MOD;
  } else {
    if (a + b >= m || s1[a] == s2[a + b])
      res[a][b] = get(a + 1, b);
    else
      res[a][b] = 0;
    if (s1[a] == s2[b - 1]) res[a][b] = (res[a][b] + get(a + 1, b - 1)) % MOD;
  }
  return res[a][b];
}
int main() {
  scanf("%s", t);
  s1 = t;
  scanf("%s", t);
  s2 = t;
  n = s1.size();
  m = s2.size();
  for (i = 0; i <= n; i++)
    for (j = 0; j <= m; j++) res[i][j] = -1;
  sum = get(1, m);
  for (i = 0; i < m; i++)
    if (s2[i] == s1[0]) sum = (sum + get(1, i)) % MOD;
  sum = (sum * 2) % MOD;
  printf("%d\n", sum);
  return 0;
}
