#include <bits/stdc++.h>
using namespace std;
const int N = 3006;
const long long mod = 998244353;
long long dp[N][N];
string a, b;
int n, m;
int main() {
  cin >> a;
  cin >> b;
  n = a.length();
  m = b.length();
  for (int i = a.length() - 1; i >= 0; i--) {
    a[i + 1] = a[i];
  }
  for (int i = b.length() - 1; i >= 0; i--) {
    b[i + 1] = b[i];
  }
  for (int i = 1; i <= 3005; i++) dp[i][i - 1] = 1;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int l = 1, r = i; r <= n; l++, r++) {
      if (l > m || a[i] == b[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      if (r > m || a[i] == b[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
    }
  }
  for (int i = m; i <= n; i++) ans = (ans + dp[1][i]) % mod;
  cout << ans << endl;
}
