#include <bits/stdc++.h>
using namespace std;
long long power[3005];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  power[0] = 1;
  for (long long i = 1; i < 3005; i++) {
    power[i] = power[i - 1] * 2;
    power[i] %= 998244353;
  }
  long long t = 1;
  long long Case = 1;
  while (t--) {
    string s, t;
    cin >> s >> t;
    long long l1 = s.length();
    long long l2 = t.length();
    long long dp[l1 + 1][l2 + 1];
    memset(dp, 0, sizeof(dp));
    for (long long i = 1; i <= l2; i++) {
      if (t[i - 1] == s[0]) dp[1][i] += 2;
    }
    for (long long i = 2; i <= l1; i++) {
      for (long long j = 1; j <= l2; j++) {
        if (s[i - 1] == t[j - 1]) {
          if (j == l2)
            dp[i][j] += (power[i - 1]);
          else
            dp[i][j] += dp[i - 1][j + 1];
          dp[i][j] %= 998244353;
        }
        if ((i + j - 2) >= l2 || s[i - 1] == t[i + j - 2])
          dp[i][j] += dp[i - 1][j];
        dp[i][j] %= 998244353;
      }
    }
    long long ans = 0;
    for (long long i = l2; i <= l1; i++) {
      ans += dp[i][1];
      ans %= 998244353;
    }
    cout << ans << endl;
  }
  return 0;
}
