#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long AN, BN;
char A[3004], B[3004];
long long d[3004][3004], D[3004];
int main() {
  scanf("%s %s", A + 1, B + 1);
  AN = strlen(A + 1), BN = strlen(B + 1);
  D[BN + 1] = 1;
  long long ans = 0;
  for (long long i = 0; i < 3002; ++i) d[i + 1][i] = 1;
  for (long long i = 1; i <= AN; ++i) {
    if (i <= BN + 1) {
      long long j = BN - i + 2;
      if (j <= BN) D[j] += d[j][BN];
      D[j] %= MOD;
    }
    for (long long j = 1; j <= BN; ++j) {
      if (BN - j + 1 >= i) continue;
      if (B[j] == A[i]) D[j] += D[j + 1];
      D[j] %= MOD;
    }
    if (i > 1) D[BN + 1] *= 2, D[BN + 1] %= MOD;
    long long l = 1, r = l + i - 1;
    while (r <= BN) {
      if (B[l] == A[i]) d[l][r] += d[l + 1][r];
      if (l < r && B[r] == A[i]) d[l][r] += d[l][r - 1];
      d[l][r] %= MOD;
      ++l;
      ++r;
    }
    if (i == BN) ans += d[1][BN];
    ans += D[1];
    ans %= MOD;
  }
  printf("%lld\n", ans * 2 % MOD);
  return 0;
}
