#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s, t;
  cin >> s >> t;
  int64_t n = s.size();
  int64_t m = t.size();
  vector<vector<int64_t>> dp(n + 1, vector<int64_t>(n + 1, 0));
  dp[0] = vector<int64_t>(n + 1, 1);
  for (int64_t i = 1; i <= n; i++) {
    for (int64_t j = 0; j < n; j++) {
      if (j < n && (j >= m || (t[j] == s[i - 1]))) {
        dp[i][j] += dp[i - 1][j + 1];
      }
      if (j + i <= n && (j + i - 1 >= m || t[j + i - 1] == s[i - 1])) {
        dp[i][j] += dp[i - 1][j];
      }
      dp[i][j] %= 998244353;
    }
  }
  int64_t res = 0;
  for (int64_t i = m; i <= n; i++) {
    res = (res + dp[i][0]) % 998244353;
  }
  cout << res << "\n";
}
