#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const long long mod = 998244353;
const int maxn = 3030;
int n, m;
string s, t;
long long dp[maxn][maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s >> t;
  n = s.length();
  m = t.length();
  for (int i = m - 1; i < n; i++) {
    if (i >= m || s[i] == t[m - 1]) {
      dp[i][0] = 1;
    }
    if (s[i] == t[0]) {
      dp[i][1] = 1;
    }
  }
  for (int i = n - 1; i > 0; i--) {
    for (int j = 0; j <= n - i; j++) {
      {
        int p = (i - 1) + j;
        if (p >= m || s[i - 1] == t[p]) {
          dp[i - 1][j] += dp[i][j];
          dp[i - 1][j] %= mod;
        }
      }
      {
        if (j >= m || s[i - 1] == t[j]) {
          dp[i - 1][j + 1] += dp[i][j];
          dp[i - 1][j + 1] %= mod;
        }
      }
    }
  }
  long long ans = 0;
  for (int j = 0; j <= n; j++) {
    ans += dp[0][j];
    ans %= mod;
  }
  ans %= mod;
  ans += mod;
  ans %= mod;
  cout << ans << endl;
  return 0;
}
