#include <bits/stdc++.h>
using namespace std;
void fast_io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const long long MAXN = 3e3 + 228;
const long long MOD = 998244353;
long long dp[MAXN][MAXN];
signed main() {
  fast_io();
  string s, t;
  cin >> s >> t;
  long long n = (long long)(s.size()), m = (long long)(t.size());
  for (long long i = 0; i < n; i++) {
    if (i >= m || s[0] == t[i]) {
      dp[i][i] = 2;
    }
  }
  for (long long len = 2; len <= n; len++) {
    char c = s[len - 1];
    for (long long i = 0; i + len <= n; i++) {
      long long j = i + len - 1;
      if (i >= m || t[i] == c) {
        dp[i][j] = (dp[i][j] + dp[i + 1][j]) % MOD;
      }
      if (j >= m || t[j] == c) {
        dp[i][j] = (dp[i][j] + dp[i][j - 1]) % MOD;
      }
    }
  }
  long long ans = accumulate(
      dp[0] + m - 1, dp[0] + n, 0,
      [](const long long& a, const long long& b) { return (a + b) % MOD; });
  cout << ans;
}
