#include <bits/stdc++.h>
using namespace std;
const int p = 998244353;
char s[400005], t[400005];
int n, m, dp[3005][3005];
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 || s[1] == t[i]) dp[i][i] = 2;
    for (int j = i - 1; j; j--) {
      if (j > m || t[j] == s[i - j + 1])
        dp[j][i] = (dp[j][i] + dp[j + 1][i]) % p;
      if (i > m || t[i] == s[i - j + 1])
        dp[j][i] = (dp[j][i] + dp[j][i - 1]) % p;
    }
  }
  int ans = 0;
  for (int i = m; i <= n; i++) ans = (ans + dp[1][i]) % p;
  printf("%d\n", ans);
}
