#include <bits/stdc++.h>
using namespace std;
void test() { cerr << "\n"; }
template <typename T, typename... Args>
void test(T x, Args... args) {
  cerr << x << " ";
  test(args...);
}
const long long mod = 998244353;
const int maxn = 1e5 + 9;
const int inf = 0x3f3f3f3f;
long long rd() {
  long long ans = 0;
  char last = ' ', ch = getchar();
  while (!(ch >= '0' && ch <= '9')) last = ch, ch = getchar();
  while (ch >= '0' && ch <= '9') ans = ans * 10 + ch - '0', ch = getchar();
  if (last == '-') ans = -ans;
  return ans;
}
char x[3009], y[3009];
int f;
long long dp[3009][3009][2];
int main() {
  scanf("%s%s", x + 1, y + 1);
  int n = strlen(x + 1), m = strlen(y + 1);
  for (int i = (int)(0); i <= (int)(m); i++) {
    int j = i + 1;
    dp[i][j][f] = 1;
  }
  long long ans = 0;
  for (int i = (int)(1); i <= (int)(n); i++) {
    for (int j = (int)(0); j <= (int)(m + 1); j++) {
      int k = min(m + 1, j + i + 1);
      dp[j][k][!f] = 0;
    }
    for (int j = (int)(0); j <= (int)(m); j++) {
      int k = min(m + 1, j + i);
      if (j && y[j] == x[i]) {
        dp[j - 1][k][!f] = (dp[j - 1][k][!f] + dp[j][k][f]) % mod;
        if (j - 1 == 0 && k == m + 1) {
          ans = (ans + dp[j][k][f]) % mod;
        }
      }
      if (k == m + 1) {
        dp[j][k][!f] = (dp[j][k][!f] + dp[j][k][f]) % mod;
        if (j == 0 && k == m + 1) {
          ans = (ans + dp[j][k][f]) % mod;
        }
      } else if (y[k] == x[i]) {
        dp[j][k + 1][!f] = (dp[j][k + 1][!f] + dp[j][k][f]) % mod;
        if (j == 0 && k + 1 == m + 1) {
          ans = (ans + dp[j][k][f]) % mod;
        }
      }
    }
    dp[m][m + 1][!f] = (dp[m][m + 1][!f] * 2) % mod;
    f = !f;
  }
  printf("%lld\n", ans);
  return 0;
}
