#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long INF = 1e18;
long long dp[3005][3005];
string s, t, a, b;
long long ns, nt;
long long dfs(long long i, long long j) {
  long long &an = dp[i][j];
  if (an != -1) return an;
  if (i == 0 && j == ns - 1) return an = 1;
  long long len = j - i + 1;
  an = 0;
  if (i == 0 && j >= nt - 1) {
    an++;
  }
  if (j + 1 < nt && t[j + 1] == s[len]) {
    an = (an + dfs(i, j + 1)) % mod;
  } else if (j + 1 >= nt && j < ns) {
    an = (an + dfs(i, j + 1)) % mod;
  }
  if (i > 0 && i - 1 < nt && t[i - 1] == s[len]) {
    an = (an + dfs(i - 1, j)) % mod;
  } else if (i > 0 && i - 1 >= nt) {
    an = (an + dfs(i - 1, j)) % mod;
  }
  return an;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (long long i = 0; i < 3005; i++)
    for (long long j = 0; j < 3005; j++) dp[i][j] = -1;
  cin >> s >> t;
  ns = s.length();
  nt = t.length();
  long long ans = 0;
  for (long long i = 0; i < ns; i++) {
    if (i < nt) {
      if (s[0] == t[i]) {
        ans = (ans + 2 * dfs(i, i)) % mod;
      }
    } else {
      ans = (ans + 2 * dfs(i, i)) % mod;
    }
  }
  cout << ans << '\n';
  return 0;
}
