#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
string s, t;
vector<vector<long long> > dp;
long long sol(int l, int r) {
  if (dp[l][r] < 0) {
    dp[l][r] = 0;
    if (l == r) {
      if (s[0] == t[l] or t[l] == '*') dp[l][r] = 2;
    } else {
      if (s[r - l] == t[l] or t[l] == '*')
        dp[l][r] = (dp[l][r] + sol(l + 1, r)) % mod;
      if (s[r - l] == t[r] or t[r] == '*')
        dp[l][r] = (dp[l][r] + sol(l, r - 1)) % mod;
    }
  }
  return dp[l][r];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> s >> t;
  int n = s.size(), m = t.size();
  for (int i = 0; i < n - m; i++) t += '*';
  dp = vector<vector<long long> >(n, vector<long long>(n, -1));
  long long res = 0;
  for (int i = m - 1; i < n; i++) res = (res + sol(0, i)) % mod;
  cout << res << endl;
}
