#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-6;
const int INF = 0x3fffffff;
const long long LINF = INF * 1ll * INF;
const double PI = acos(-1.0);
const int MOD = 998244353;
char s[3005], t[3005];
int dp[3005][3005];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int lens = strlen(s + 1);
  int lent = strlen(t + 1);
  for (int i = 1; i <= lens; i++) {
    if (i > lent || s[1] == t[i]) dp[i][i] = 2;
  }
  for (int k = 2; k <= lens; k++) {
    for (int l = 1; l + k - 1 <= lens; l++) {
      int r = l + k - 1;
      if (l > lent || s[k] == t[l]) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % MOD;
      if (r > lent || s[k] == t[r]) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % MOD;
    }
  }
  int ans = 0;
  for (int i = lent; i <= lens; i++) ans = (ans + dp[1][i]) % MOD;
  printf("%d\n", ans);
  return 0;
}
