#include <bits/stdc++.h>
using namespace std;
long long M = 998244353;
long long dp[3005][3005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  string t;
  cin >> t;
  int n = s.size();
  int m = t.size();
  for (int i = 0; i < m; i++) {
    if (s[0] == t[i]) {
      dp[i][i] = 2LL;
    }
  }
  dp[m][m] = 2LL;
  long long result = 0;
  for (int i = 1; i < n; i++) {
    int sz = i + 1;
    for (int j = 0; j < m; j++) {
      if (t[j] == s[i]) {
        int l = j - sz + 1;
        int r = j;
        if (l >= 0) {
          dp[l][r] = (dp[l][r] + dp[l][r - 1]) % M;
        }
        l = j;
        r = min(m, j + sz - 1);
        dp[l][r] = (dp[l][r] + dp[l + 1][r]) % M;
      }
    }
    dp[m][m] = (dp[m][m] * 2LL) % M;
    int l = max(0, m - sz + 1);
    int r = m;
    if (sz <= m + 1) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % M;
    result = (result + dp[0][m]) % M;
  }
  result = (dp[0][m - 1] + result) % M;
  cout << result << '\n';
  return 0;
}
