#include <bits/stdc++.h>
#pragma optimize("Ofast")
using namespace std;
const long long INF = 5e18;
const long long mod = 998244353;
string s, t;
long long ddpp[3007][3007];
vector<long long> v[30];
long long dp[3007][3007];
long long f(long long l, long long r) {
  if (ddpp[l][r] >= 0) return ddpp[l][r] = ddpp[l][r] % mod;
  long long sz = r - l + 1;
  long long re = 0;
  if (l == r) {
    return 2 * (s[0] == t[l]) % mod;
  }
  if (s[sz - 1] == t[l]) re += f(l + 1, r);
  if (s[sz - 1] == t[r]) re += f(l, r - 1);
  return ddpp[l][r] = re % mod;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cin >> s >> t;
  long long n = s.size();
  long long m = t.size();
  for (long long i = 0; i < s.size(); i++) {
    v[s[i] - 'a'].push_back(i);
  }
  for (long long i = 0; i <= m + 2; i++)
    for (long long j = 0; j <= m + 3; j++) ddpp[i][j] = -1;
  long long p = 1;
  for (long long i = 0; i <= n; i++) dp[i][0] = p, p = p * 2 % mod;
  dp[0][0]++;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= min(i, m); j++) {
      if (i == j) {
        dp[i][j] = f(m - j, m - 1) % mod;
        continue;
      }
      dp[i][j] = dp[i - 1][j];
      if (s[i - 1] == t[m - j]) dp[i][j] += dp[i - 1][j - 1];
      dp[i][j] %= mod;
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans += dp[i][m];
    ans %= mod;
  }
  cout << ans % mod << '\n';
}
