#include <bits/stdc++.h>
using namespace std;
long long dp[3001][3001], dp2[3001][3001];
int main(int argc, char** argv) {
  ios::sync_with_stdio(false), cin.tie(0);
  string s, t;
  cin >> s >> t;
  int m = t.length(), n = s.length();
  if (n < m) {
    cout << "0\n";
    return 0;
  }
  for (int j = 0; j < m; j++) dp2[0][j] = (s[0] == t[j] ? 2 : 0);
  for (int k = 1; k < n; k++) {
    for (int j = 0; j + k < m; j++) {
      dp2[k][j] = 0;
      int l = j + k;
      if (s[k] == t[l]) dp2[k][j] = (dp2[k][j] + dp2[k - 1][j]) % 998244353ll;
      if (s[k] == t[j])
        dp2[k][j] = (dp2[k][j] + dp2[k - 1][j + 1]) % 998244353ll;
    }
  }
  dp[0][m - 1] = (s[0] == t[m - 1] ? 2 : 0);
  dp[0][m] = 2;
  long long pow2 = 4;
  for (int k = 1; k < n; k++) {
    for (int r = 0; r < m; r++) {
      dp[k][r] = 0;
      if (s[k] == t[r]) {
        dp[k][r] = (dp[k][r] + dp[k - 1][r + 1]) % 998244353ll;
      }
      if (k + 1 > m - r) {
        dp[k][r] = (dp[k][r] + dp[k - 1][r]) % 998244353ll;
      } else {
        if (k + 1 != m - r) continue;
        if (s[k] != t[m - 1]) continue;
        dp[k][r] = (dp[k][r] + dp2[k - 1][r]) % 998244353ll;
      }
    }
    dp[k][m] = pow2;
    pow2 = (pow2 * 2ll) % 998244353ll;
  }
  long long ans = 0;
  for (int k = 0; k < n; k++) ans = (ans + dp[k][0]) % 998244353ll;
  cout << ans << '\n';
  return 0;
}
