#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
const long long mod = 998244353;
long long dp[N][N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(32);
  string s, t;
  cin >> s >> t;
  int n = s.size();
  int m = t.size();
  while (t.size() < n) {
    t += "#";
  }
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    dp[1][i] = (t[i - 1] == '#' || t[i - 1] == s[0]);
  }
  for (int len = 2; len <= n; len++) {
    for (int i = 1; i + len - 1 <= n; i++) {
      if (t[i - 1] == '#' || t[i - 1] == s[len - 1]) {
        dp[len][i] += dp[len - 1][i + 1];
        if (dp[len][i] >= mod) dp[len][i] -= mod;
      }
      if (t[i + len - 2] == '#' || t[i + len - 2] == s[len - 1]) {
        dp[len][i] += dp[len - 1][i];
        if (dp[len][i] >= mod) dp[len][i] -= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = m; i <= n; i++) {
    ans += dp[i][1];
  }
  (ans *= 2) %= mod;
  cout << ans << endl;
  return 0;
}
