#include <bits/stdc++.h>
using namespace std;
const long long P = 998244353;
const int N = 3005;
mt19937 rng(time(0));
char s[N], t[N];
int n, m, ans = 0, dp[N][N];
int main() {
  cin >> (s + 1) >> (t + 1);
  n = strlen(s + 1), m = strlen(t + 1);
  reverse(s + 1, s + n + 1);
  dp[0][0] = 1;
  for (int i = (1); i <= (n); ++i) {
    if (n - i + 1 > m)
      dp[i][0] = dp[i - 1][0] + 1;
    else
      dp[i][0] = (s[i] == t[n - i + 1]) * dp[i - 1][0];
    for (int j = (1); j <= (i); ++j) {
      bool f1 = (n - i + j + 1 > m) || s[i] == t[n - i + j + 1],
           f2 = j > m || s[i] == t[j];
      dp[i][j] = (f1 * dp[i - 1][j] + f2 * dp[i - 1][j - 1]) % P;
    }
  }
  for (int j = (0); j <= (n); ++j) ans = (ans + dp[n][j]) % P;
  cout << ans;
  return 0;
}
