#include <bits/stdc++.h>
using namespace std;
long long n, m;
string s, t;
long long dp[3003][3003];
long long rec(long long l, long long r, long long ind) {
  if (l > r) return 1;
  if (dp[l][r] != -1) return dp[l][r];
  long long ans = 0;
  if (l >= m || s[ind] == t[l]) ans = rec(l + 1, r, ind - 1);
  if (r >= m || s[ind] == t[r])
    ans = (ans + rec(l, r - 1, ind - 1)) % 998244353;
  return dp[l][r] = ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(dp, -1, sizeof(dp));
  cin >> s >> t;
  n = s.length();
  m = t.length();
  long long ans = 0;
  for (long long i = m - 1; i < n; i++) ans = (ans + rec(0, i, i)) % 998244353;
  cout << ans << "\n";
}
