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