#include <bits/stdc++.h>
using namespace std;
const int N = 3030;
const int Mod = 998244353;
int n, m;
int Dp[N][N];
string S, T;
int Solve(int rem, int L, int R) {
  if (rem == -1) return 1;
  int& ret = Dp[rem][L];
  if (ret + 1) return ret;
  ret = 0;
  if (L >= m || S[rem] == T[L]) ret = (ret + Solve(rem - 1, L + 1, R)) % Mod;
  if (R >= m || S[rem] == T[R]) ret = (ret + Solve(rem - 1, L, R - 1)) % Mod;
  return ret;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> S;
  n = S.size();
  cin >> T;
  m = T.size();
  memset(Dp, -1, sizeof Dp);
  int Ans = 0;
  for (int i = m - 1; i < n; i++) Ans = (Ans + Solve(i, 0, i)) % Mod;
  cout << Ans << '\n';
  return 0;
}
