#include <bits/stdc++.h>
using std::cin;
using std::cout;
int dp[3000 + 1][3000 + 1];
char s[3000 + 1], t[3000 + 1];
int qmod(int x) { return (x < 998244353) ? x : x - 998244353; }
int main() {
  cin >> s >> t;
  int n = strlen(s);
  int m = strlen(t);
  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 i = 0; i + len <= n; ++i) {
      int j = i + len;
      if (i >= m || t[i] == c) dp[i][j] = qmod(dp[i][j] + dp[i + 1][j]);
      if (j > m || t[j - 1] == c) dp[i][j] = qmod(dp[i][j] + dp[i][j - 1]);
    }
  }
  int ans = 0;
  for (int i = m; i <= n; ++i) ans = qmod(ans + dp[0][i]);
  cout << ans;
  return 0;
}
