#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size();
  long long ans = 0;
  for (int i = m; i < n; i++) t += '*';
  vector<vector<long long> > dp(n + 1, vector<long long>(n + 1));
  for (int i = 0; i <= n; i++) dp[i][0] = 1;
  for (int k = 1; k <= n; k++) {
    for (int i = 0; i + k <= n; i++) {
      int j = i + k - 1;
      if (t[j] == '*' || t[j] == s[k - 1])
        dp[i][k] = (dp[i][k] + dp[i][k - 1]) % 998244353;
      if (t[i] == '*' || t[i] == s[k - 1])
        dp[i][k] = (dp[i][k] + dp[i + 1][k - 1]) % 998244353;
    }
  }
  for (int i = m; i <= n; i++) ans = (ans + dp[0][i]) % 998244353;
  cout << ans << endl;
  return 0;
}
