#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long n = s.size();
  string t;
  cin >> t;
  long long m = t.size();
  vector<vector<long long> > dp(n + 1, vector<long long>(n + 1, 0));
  long long ans = 0;
  for (int k = 0; k < n; k++) {
    for (int i = 0; i + k < n; i++) {
      if (k == 0) {
        if (i >= m || s[0] == t[i]) dp[k][i] = 2;
      } else {
        if (i >= m || s[k] == t[i]) dp[k][i] += dp[k - 1][i + 1];
        if (i + k >= m || s[k] == t[i + k]) dp[k][i] += dp[k - 1][i];
      }
      dp[k][i] %= 998244353;
      if (i == 0 && i + k + 1 >= m) ans += dp[k][i];
      ans %= 998244353;
    }
  }
  cout << ans << endl;
  return 0;
}
