#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << ' ' << H;
  debug_out(T...);
}
const long long INF = 1e15;
const long long MOD = 998244353;
const int N = 3e3 + 2;
int DP[N][N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  mt19937 Rnd(time(0));
  string S, T;
  cin >> S >> T;
  int n = (int)(S.size()), m = (int)(T.size());
  for (int i = 0; i < n; i++) DP[0][i] = 2 * (i >= m || S[0] == T[i]);
  for (int i = 1; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (j >= m || S[i] == T[j])
        DP[i][j] = (DP[i][j] + DP[i - 1][j + 1]) % MOD;
      if (j + i >= m || S[i] == T[j + i])
        DP[i][j] = (DP[i][j] + DP[i - 1][j]) % MOD;
    }
  int ans = 0;
  for (int i = m - 1; i < n; i++) ans = (ans + DP[i][0]) % MOD;
  cout << ans << '\n';
  return 0;
}
