#include <bits/stdc++.h>
using namespace std;
void shikhar7s(long long int cas) {
  string s, t;
  cin >> s >> t;
  long long int n = (long long int)s.length(), m = (long long int)t.length(), i,
                j;
  long long int dp[n + 5][n + 5];
  memset(dp, 0, sizeof(dp));
  for (i = m; i < n + 1; i++) {
    dp[i][0] = 1;
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < n; j++) {
      if (j + i >= m || t[j + i] == s[i]) {
        dp[i][j] = (dp[i][j] + dp[i + 1][j]) % 998244353;
      }
      if (j >= m || t[j] == s[i]) {
        dp[i][j + 1] = (dp[i][j + 1] + dp[i + 1][j]) % 998244353;
      }
    }
  }
  long long int ans = 0;
  for (i = 0; i < n + 1; i++) {
    ans = (ans + dp[0][i]) % 998244353;
  }
  cout << ans;
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  long long int cas = 1;
  while (cas <= t) {
    shikhar7s(cas);
    cas++;
  }
  return 0;
}
