#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return;
}
inline void out(long long x) {
  if (x > 9) out(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 3010;
const int mod = 998244353;
int dp[maxn][maxn] = {0};
char s[maxn], t[maxn];
int main() {
  scanf("%s %s", s + 1, t + 1);
  int sn = strlen(s + 1);
  int tn = strlen(t + 1);
  for (int i = 1; i <= maxn; i++) dp[i][i - 1] = 1;
  for (int i = 1; i <= sn; i++) {
    for (int l = 1, r = i; r <= sn; l++, r++) {
      if (l > tn || s[i] == t[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      if (r > tn || s[i] == t[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
    }
  }
  long long ans = 0;
  for (int i = tn; i <= sn; i++) ans = (ans + dp[1][i]) % mod;
  out(ans);
}
