#include <bits/stdc++.h>
using namespace std;
const int N = 3010, mod = 998244353;
char s[N], t[N];
int f[N][N];
int main() {
  scanf("%s %s", s + 1, t + 1);
  int n = strlen(s + 1);
  int m = strlen(t + 1);
  for (int i = 1; i <= n + 1; i++) f[i][i - 1] = 1;
  for (int i = 1; i <= n; i++) {
    for (int l = 1; l + i - 1 <= n; l++) {
      int r = l + i - 1;
      if (s[i] == t[l] || l > m) f[l][r] = (f[l][r] + f[l + 1][r]) % mod;
      if (s[i] == t[r] || r > m) 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 << endl;
  return 0;
}
