#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n, m;
string s, t;
long long dp[3220][3020];
long long calc(int i, int l) {
  if (dp[i][l] != -1) return dp[i][l];
  long long &res = dp[i][l];
  int r = i + l;
  if (l == 0 && r >= m - 1) {
    res = n - i;
    return dp[i][l];
  }
  res = 0;
  if (l - 1 >= 0 && l - 1 >= m) res = (res + calc(i + 1, l - 1)) % mod;
  if (r + 1 < n && r + 1 >= m) res = (res + calc(i + 1, l)) % mod;
  if (l - 1 >= 0 && l - 1 < m && s[i + 1] == t[l - 1])
    res = (res + calc(i + 1, l - 1)) % mod;
  if (r + 1 < n && r + 1 < m && s[i + 1] == t[r + 1])
    res = (res + calc(i + 1, l)) % mod;
  return dp[i][l];
}
void solve() {
  cin >> s >> t;
  n = (int)s.size(), m = (int)t.size();
  if (m > n) {
    cout << 0 << "\n";
    return;
  }
  memset(dp, -1, sizeof dp);
  long long ans = 0;
  for (int i = 0; i < n; ++i)
    if (i >= m || s[0] == t[i]) {
      ans = (ans + calc(0, i)) % mod;
    }
  ans = (ans * 2) % mod;
  cout << ans << "\n";
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
