#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
string s, t;
long long n, m;
long long MOD = 998244353;
long long dp[3005][3005];
long long rec(long long i, long long j) {
  if (!j) {
    if (i >= m || t[i] == s[j]) return 2;
    return 0;
  }
  if (dp[i][j] != -22) return dp[i][j];
  if (i >= m) {
    dp[i][j] = MOD + rec(i, j - 1) + rec(i + 1, j - 1);
    dp[i][j] %= MOD;
    return dp[i][j];
  }
  dp[i][j] = 0;
  if (s[j] == t[i]) dp[i][j] = (dp[i][j] + MOD + rec(i + 1, j - 1)) % MOD;
  if (i + j >= m || s[j] == t[i + j])
    dp[i][j] = (dp[i][j] + MOD + rec(i, j - 1)) % MOD;
  dp[i][j] = (dp[i][j] + MOD) % MOD;
  return dp[i][j];
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s >> t;
  n = s.size();
  m = t.size();
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) dp[i][j] = -22;
  long long ans = 0;
  for (long long i = m - 1; i < n; ++i) ans = (ans + MOD + rec(0, i)) % MOD;
  cout << ans;
}
