#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const long long N = 3005, mod = 998244353;
string s, t;
long long n, m, ans, dp[N][N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s >> t;
  n = s.size(), m = t.size();
  s = "$" + s, t = "$" + t;
  for (long long i = m; i <= n; i++)
    if (i > m || s[i] == t[m]) dp[i][0] = 1;
  for (long long i = m; i <= n; i++)
    if (s[i] == t[1]) dp[i][1] = 1;
  for (long long i = n; i > 1; i--) {
    for (long long j = 0; j <= n - i + 1; j++) {
      if (j + 1 > m || s[i - 1] == t[j + 1])
        dp[i - 1][j + 1] += dp[i][j], dp[i - 1][j + 1] %= mod;
      if (j + i - 1 > m || s[i - 1] == t[j + i - 1])
        dp[i - 1][j] += dp[i][j], dp[i - 1][j] %= mod;
    }
  }
  for (long long i = 0; i <= n; i++) ans += dp[1][i], ans %= mod;
  cout << ans;
}
