#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
const int mod = 998244353;
int n, m;
char s[N], t[N];
int dp[N][N];
int main() {
  cin >> (s + 1) >> (t + 1);
  n = strlen(s + 1), m = strlen(t + 1);
  for (int len = 1; len <= n; len++) {
    for (int l = 1, r = len; r <= n; l++, r++) {
      if (l > m || s[len] == t[l])
        dp[l][r] += (l == r) ? 1 : dp[l + 1][r], dp[l][r] %= mod;
      if (r > m || s[len] == t[r])
        dp[l][r] += (l == r) ? 1 : dp[l][r - 1], dp[l][r] %= mod;
    }
  }
  int ans = 0;
  for (int i = m; i <= n; i++) ans = (ans + dp[1][i]) % mod;
  cout << ans << endl;
  return 0;
}
