#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 30;
const int inf = 0x7ffffff;
const int mod = 998244353;
char s[maxn], t[maxn];
int dp[maxn][maxn];
void solve() {
  cin >> (s + 1) >> (t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  for (int i = 1; i <= n + 10; i++) dp[i][i - 1] = 1;
  for (int i = 1; i <= n; i++) {
    for (int l = 1, r = i + l - 1; r <= n; l++, r++) {
      if (l > m || s[i] == t[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      if (r > m || s[i] == t[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
    }
  }
  long long ans = 0;
  for (int i = m; i <= n; i++) ans = (ans + dp[1][i]) % mod;
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T = 1;
  while (T-- > 0) solve();
}
