#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int maxn = 5000;
const int INF = 1000000090;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int dp[maxn][maxn];
string s1, s2;
int main() {
  cin >> s1 >> s2;
  int l1 = s1.size();
  int l2 = s2.size();
  for (int i = 0; i < l1; i++) {
    int asd = 0;
    for (int j = i; j < l1 + 1; j++) {
      if (!i) dp[asd][j - 1] = 1;
      if (asd) {
        if (asd - 1 >= l2 || s2[asd - 1] == s1[i]) {
          dp[asd - 1][j - 1] += dp[asd][j - 1];
          dp[asd - 1][j - 1] %= mod;
        }
      }
      if (j < l1) {
        if (j >= l2 || s2[j] == s1[i]) {
          dp[asd][j] += dp[asd][j - 1];
          dp[asd][j] %= mod;
        }
      }
      asd++;
    }
  }
  int sum = 0;
  for (int i = l2 - 1; i < l1; i++) {
    sum += dp[0][i];
    sum %= mod;
  }
  cout << sum << "\n";
  return 0;
}
