#include <bits/stdc++.h>
using namespace std;
inline void read(int &p) {
  p = 0;
  int flag = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    p = p * 10 + c - '0';
    c = getchar();
  }
  p *= flag;
}
const int mod = 998244353;
int main() {
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size();
  vector<vector<long long> > dp(n + 1, vector<long long>(n + 1));
  for (int i = 0; i <= n; i++) dp[i][i] = 1;
  for (int len = 1; len <= n; len++) {
    char c = s[len - 1];
    for (int l = 0; l + len <= n; l++) {
      int r = l + len;
      if (l >= m || t[l] == c) {
        dp[l][r] += dp[l + 1][r];
        dp[l][r] %= mod;
      }
      if (r > m || t[r - 1] == c) {
        dp[l][r] += dp[l][r - 1];
        dp[l][r] %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = m; i <= n; i++) {
    ans += dp[0][i];
    ans %= mod;
  }
  cout << ans;
  return 0;
}
