#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 10;
const int N = 1e5;
bool isprime[N + 10];
int prime[N + 10], k;
void add() {
  k = 0;
  memset(isprime, true, sizeof(isprime));
  isprime[1] = false;
  for (int i = 1; i <= N; i++) {
    if (isprime[i]) {
      prime[++k] = i;
      for (int j = 2; j * i <= N; j++) {
        isprime[j * i] = false;
      }
    }
  }
}
int find(int n) {
  int ans = 0, flag = 0;
  ;
  for (long long i = 1; i <= k && prime[i] * prime[i] <= n; i++) {
    if (n % prime[i] == 0) {
      while (n % prime[i] == 0) {
        if (prime[i] != 2)
          ans++;
        else
          flag = 1;
        n = n / prime[i];
      }
    }
  }
  if (n > 1) ans++;
  return ans + flag;
}
char s[maxn], t[maxn];
const int mode = 998244353;
long long dp[maxn][maxn];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  for (int i = 1; i <= m; i++) {
    if (s[1] == t[i]) dp[i][i] = 2;
  }
  for (int i = m + 1; i <= n; i++) {
    dp[i][i] = 2;
  }
  for (int len = 2; len <= n; len++) {
    char ch = s[len];
    for (int l = 1; l + len - 1 <= n; l++) {
      int r = l + len - 1;
      if (l > m || ch == t[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mode;
      if (r > m || ch == t[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mode;
    }
  }
  long long ans = 0;
  for (int i = m; i <= n; i++) ans = (ans + dp[1][i]) % mode;
  cout << ans << endl;
  return 0;
}
