#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (y > x) x = y;
}
const long long int mod = 998244353;
const long long inf = (long long int)1e18 + 17;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
void solve() {
  string s, m;
  cin >> s >> m;
  int n = s.size();
  vector<vector<long long int>> dp(n + 10, vector<long long int>(n + 10, 0));
  for (int i = 0; i < n; i++) {
    if (i < m.size())
      dp[i][i] = ((m[i] == s[0]) ? 2 : 0);
    else
      dp[i][i] = 2;
  }
  for (int len = 2; len <= n; len++) {
    for (int i = 0; i < n; i++) {
      int j = i + len - 1;
      if (j >= n) break;
      if (i >= m.size()) {
        dp[i][j] = (dp[i][j] + dp[i + 1][j]) % mod;
      } else if (s[len - 1] == m[i])
        dp[i][j] = (dp[i][j] + dp[i + 1][j]) % mod;
      if (j >= m.size()) {
        dp[i][j] = (dp[i][j] + dp[i][-1 + j]) % mod;
      } else if (s[len - 1] == m[j])
        dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
    }
  }
  long long int ans = 0;
  for (int i = -1 + m.size(); i < n; i++) ans = (ans + dp[0][i]) % mod;
  cout << ans << endl;
}
int main() {
  clock_t tt;
  tt = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  tt = clock() - tt;
  double time_taken = ((double)tt) / CLOCKS_PER_SEC;
  return 0;
}
