#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long mod = 998244353;
char s[3005], t[3005];
int n, m;
long long dp[3005][3005];
int main() {
  ios::sync_with_stdio(false);
  cin >> s + 1;
  cin >> t + 1;
  n = strlen(s + 1);
  m = strlen(t + 1);
  for (int i = 1; i <= m; i++)
    if (t[i] == s[1]) dp[i][i] = 2;
  for (int i = m + 1; i <= n; i++) dp[i][i] = 2;
  for (int len = 2; len <= n; len++) {
    for (int l = 1; l <= n - len + 1; l++) {
      int r = l + len - 1;
      if (l > m || t[l] == s[len]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      if (r > m || t[r] == s[len]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
    }
  }
  long long sum = 0;
  for (int i = m; i <= n; i++) {
    sum = (sum + dp[1][i]) % mod;
  }
  cout << sum << endl;
  return 0;
}
