#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 3, MOD = 998244353;
int dp[N][N];
int main() {
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size(), res = 2, ans = 0;
  for (int j = 0; j < m; j++)
    if (s[0] == t[j]) dp[0][j] = 2;
  if (m == 1) ans = dp[0][0];
  dp[0][m] = res;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (j + i >= m || t[j + i] == s[i])
        dp[i][j] = (dp[i][j] + dp[i - 1][j]) % MOD;
      if (t[j] == s[i]) dp[i][j] = (dp[i][j] + dp[i - 1][j + 1]) % MOD;
    }
    res = 2ll * res % MOD;
    dp[i][m] = res;
    if (i + 1 >= m) ans = (ans + dp[i][0]) % MOD;
  }
  cout << ans << "\n";
  return 0;
}
