#include <bits/stdc++.h>
using namespace std;
const int N = 3000 + 20, mod = 998244353;
int n, m, dp[2][N], ans;
string s, t;
int sum(int a, int b) { return ((1LL * a + b) % mod + mod) % mod; }
int mul(int a, int b) { return ((1LL * a * b) % mod + mod) % mod; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> s >> t;
  n = s.size();
  m = t.size();
  for (int i = 0; i < m; i++) {
    if (t[i] == s[0]) dp[1][i] = 2;
  }
  dp[1][m] = 2;
  if (m == 1) ans = dp[1][0];
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < m; j++) {
      dp[i & 1][j] = 0;
      if (s[i - 1] == t[j]) dp[i & 1][j] = dp[~i & 1][j + 1];
      if (i + j > m || s[i - 1] == t[i + j - 1])
        dp[i & 1][j] = sum(dp[i & 1][j], dp[~i & 1][j]);
    }
    dp[i & 1][m] = mul(dp[~i & 1][m], 2);
    if (i >= m) ans = sum(ans, dp[i & 1][0]);
  }
  return cout << ans << endl, 0;
}
