#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5;
int n, m, mod = 998244353, dp[N][N];
string t, second;
int mul(int a, int b) {
  a = (a + mod) % mod;
  b = (b + mod) % mod;
  return (1ll * a * b) % mod;
}
int add(int a, int b) {
  a = (a + mod) % mod;
  b = (b + mod) % mod;
  return (a + b) % mod;
}
int solve(int l, int r) {
  if (l == 0 && r == n + 1) return 1;
  if (dp[l][r] != -1) return dp[l][r];
  int ans = 0, idx = r - l;
  if (l == 0 && r > m) ans = 1;
  if (l > 0 && l <= m && second[idx] == t[l]) ans = add(ans, solve(l - 1, r));
  if (l > m) ans = add(ans, solve(l - 1, r));
  if (r <= m && second[idx] == t[r]) ans = add(ans, solve(l, r + 1));
  if (r <= n && r > m) ans = add(ans, solve(l, r + 1));
  return dp[l][r] = ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(dp, -1, sizeof(dp));
  cin >> second >> t;
  n = second.size(), m = t.size();
  second = ' ' + second;
  t = ' ' + t;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (i <= m && second[1] == t[i])
      ans = add(ans, mul(2, solve(i - 1, i + 1)));
    else if (i > m)
      ans = add(ans, mul(2, solve(i - 1, i + 1)));
  }
  cout << ans << '\n';
  return 0;
}
