#include <bits/stdc++.h>
using namespace std;
int n, m;
char s[3005], t[3005];
int f[3005][3005];
const int MOD = 998244353;
int main() {
  cin >> s + 1 >> t + 1;
  n = strlen(s + 1);
  m = strlen(t + 1);
  for (int i = 1; i <= m; i++) {
    if (s[1] == t[i]) f[i][i] = 2;
  }
  for (int i = m + 1; i <= n; i++) f[i][i] = 2;
  for (int i = 2; i <= n; i++) {
    for (int l = 1; l + i - 1 <= n; l++) {
      int r = l + i - 1;
      if (r > n) continue;
      if (l > m || s[i] == t[l]) f[l][r] = (f[l][r] + f[l + 1][r]) % MOD;
      if (r > m || s[i] == t[r]) f[l][r] = (f[l][r] + f[l][r - 1]) % MOD;
    }
  }
  int ans = 0;
  for (int i = m; i <= n; i++) ans = (ans + f[1][i]) % MOD;
  cout << ans;
  return 0;
}
