#include <bits/stdc++.h>
using namespace std;
const int N = 6007;
const long long mod = 998244353;
long long dp[N][N];
int n, m;
string s, a;
int main() {
  cin >> a >> s;
  n = s.length();
  m = a.length();
  s = ' ' + s;
  a = ' ' + a;
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= m; i++)
    if (i > n || s[i] == a[1]) dp[i][i] = 2;
  long long ans = 0;
  ans += dp[1][n];
  for (int i = 2; i <= m; i++) {
    for (int l = 1; l + i - 1 <= m; l++) {
      if (l > n || a[i] == s[l]) dp[l][l + i - 1] += dp[l + 1][l + i - 1];
      dp[l][l + i - 1] %= mod;
      if (l + i - 1 > n || a[i] == s[l + i - 1])
        dp[l][l + i - 1] += dp[l][l + i - 2];
      dp[l][l + i - 1] %= mod;
    }
    if (i >= n) ans += dp[1][i];
    ans %= mod;
  }
  cout << ans;
}
