#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 5;
const int mod = 998244353;
char s[maxn], t[maxn];
int m, n, dp[maxn][maxn];
int main() {
  scanf("%s%s", s + 1, t + 1);
  n = strlen(s + 1);
  m = strlen(t + 1);
  for (int i = 1; i <= n; i++) {
    if (i > m || t[i] == s[1]) dp[i][i] = 2;
  }
  for (int len = 2; len <= n; len++) {
    char ch = s[len];
    for (int l = 1; l + len - 1 <= n; l++) {
      int r = l + len - 1;
      if (l > m || ch == t[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      if (r > m || ch == t[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
    }
  }
  int ans = 0;
  for (int i = m; i <= n; i++) ans = (ans + dp[1][i]) % mod;
  cout << ans << endl;
}
