#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e3 + 5;
const int inf = (int)2e9 + 7;
const long long mod = 998244353;
char s[maxn], t[maxn];
long long dp[maxn][maxn];
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> (s + 1) >> (t + 1);
  long long n = strlen(s + 1), m = strlen(t + 1);
  for (long long i = 1; i <= n + 1; i++) {
    dp[i][i - 1] = 1;
  }
  for (long long len = 1; len <= n; len++) {
    for (long long i = 1; i <= n; i++) {
      long long j = i + len - 1;
      if (j > n) {
        break;
      }
      if (j > m || s[len] == t[j]) {
        dp[i][j] += dp[i][j - 1];
        dp[i][j] %= mod;
      }
      if (i > m || s[len] == t[i]) {
        dp[i][j] += dp[i + 1][j];
        dp[i][j] %= mod;
      }
    }
  }
  long long ans = 0;
  for (long long i = m; i <= n; i++) {
    ans += dp[1][i];
    ans %= mod;
  }
  cout << ans << "\n";
  return 0;
}
