#include <bits/stdc++.h>
using namespace std;
string s, t;
int n, m;
long long dp[3010][3010];
long long mod = 998244353;
int main() {
  cin >> s >> t;
  n = s.size();
  m = t.size();
  for (int i = 1; i <= 3005; i++) {
    dp[i][i - 1] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int l = 1, r = l + i; r <= n; l++, r++) {
      if (l > m || s[i] == t[l - 1]) {
        dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      }
      if (r > m || s[i] == t[r - 1]) {
        dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
      }
    }
  }
  long long ans = 0;
  for (int i = m; i <= n; i++) {
    ans += dp[1][i];
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
