#include <bits/stdc++.h>
using namespace std;
string a, b;
long long ans, dp[3100][3100], n, m;
long long solve(int l, int r) {
  if (l == -1 && r == a.size()) return 1;
  if (dp[l + 1][r + 1] != -1) return dp[l + 1][r + 1];
  long long res = ((l == -1) & (r >= m));
  if (l > -1)
    if (a[r - l - 1] == b[l] || b[l] == '!') res += solve(l - 1, r);
  if (r < a.size())
    if (a[r - l - 1] == b[r] || b[r] == '!') res += solve(l, r + 1);
  return dp[l + 1][r + 1] = res % 998244353;
}
int main() {
  cin >> a >> b;
  n = a.size();
  m = b.size();
  for (int i = 0; i < n + 4; i++)
    for (int j = 0; j < n + 6; j++) dp[i][j] = -1;
  for (int i = b.size(); i < a.size(); i++) b += '!';
  for (int i = 0; i < a.size(); i++) {
    if (a[0] == b[i] || b[i] == '!') {
      ans += solve(i - 1, i + 1);
      ans %= 998244353;
    }
  }
  ans *= 2;
  ans %= 998244353;
  printf("%lld\n", ans);
  return 0;
}
