#include <bits/stdc++.h>
using namespace std;
const long long int N = 3005;
string s, t;
long long int n, m;
long long int dp[N][N];
void solve() {
  cin >> s >> t;
  n = s.size(), m = t.size();
  s = '*' + s, t = '*' + t;
  for (long long int i = m + 1; i <= n; i++) t.push_back('*');
  for (long long int j = 1; j <= n + 1; j++) dp[0][j] = 1;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= n; j++) {
      if (j + i - 1 > n) break;
      dp[i][j] +=
          (dp[i - 1][j] * (s[i] == t[j + i - 1] || t[j + i - 1] == '*') +
           dp[i - 1][j + 1] * (s[i] == t[j] || t[j] == '*')) %
          998244353;
    }
  }
  long long int ans = 0;
  for (long long int i = m; i <= n; i++) ans = (ans + dp[i][1]) % 998244353;
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cout.precision(20);
  long long int t = 1;
  for (long long int i = 1; i <= t; i++) {
    if (0) cout << "Case #" << i << ": ";
    solve();
  }
}
