#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3010;
const long long MODN = 998244353;
char s[MAXN], t[MAXN];
int32_t main() {
  scanf("%s %s", s + 1, t + 1);
  long long n = strlen(s + 1);
  long long m = strlen(t + 1);
  vector<vector<long long>> dp(MAXN, vector<long long>(MAXN, 0));
  for (long long len = 1; len <= n; len++)
    for (long long l = 1; l + len - 1 <= n; l++) {
      long long r = l + len - 1;
      if (len == 1) {
        if (l > m || s[len] == t[l]) dp[l][r] = 2;
        continue;
      }
      if (l > m || s[len] == t[l]) dp[l][r] += dp[l + 1][r], dp[l][r] %= MODN;
      if (r > m || s[len] == t[r]) dp[l][r] += dp[l][r - 1], dp[l][r] %= MODN;
    }
  long long sum = 0;
  for (long long i = m; i <= n; i++) sum += dp[1][i], sum %= MODN;
  cout << sum << endl;
  return 0;
}
