#include <bits/stdc++.h>
using namespace std;
char s[5001], t[5001];
long long dp[5001][5001];
const long long M = 998244353;
int main() {
  scanf("%s%s", s, t);
  int n = strlen(s);
  int m = strlen(t);
  for (int i = 0; i < n; ++i)
    if (i >= m || s[0] == t[i]) dp[i][i] = 2;
  for (int k = 1; k < n; ++k) {
    for (int i = 0; i + k < n; ++i) {
      int j = i + k;
      if (i >= m || s[k] == t[i]) dp[i][j] = (dp[i][j] + dp[i + 1][j]) % M;
      if (j >= m || s[k] == t[j]) dp[i][j] = (dp[i][j] + dp[i][j - 1]) % M;
    }
  }
  long long ans = 0;
  for (int i = m - 1; i < n; ++i) {
    ans = (ans + dp[0][i]) % M;
  }
  printf("%lld", ans);
}
