#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long mod = 998244353;
void solve() {
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size();
  vector<vector<long long>> dp(n + 2, vector<long long>(n + 2));
  for (int j = 0; j < n; j++) {
    if (j < m) {
      if (s[0] == t[j]) dp[1][j] = 2;
    } else {
      dp[1][j] = 2;
    }
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < n; j++) {
      {
        if (j < m) {
          if (s[i - 1] == t[j]) dp[i][j] = (dp[i][j] + dp[i - 1][j + 1]) % mod;
        } else {
          dp[i][j] = (dp[i][j] + dp[i - 1][j + 1]) % mod;
        }
      }
      {
        if ((i + j - 1) < m) {
          if (s[i - 1] == t[i + j - 1])
            dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
        } else {
          dp[i][j] = (dp[i - 1][j] + dp[i][j]) % mod;
        }
      }
    }
  }
  long long ans = 0;
  for (int i = m; i <= n; i++) {
    ans = (ans + dp[i][0]) % mod;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  std::cout << std::fixed << std::setprecision(20);
  ;
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
