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