#include <bits/stdc++.h>
constexpr int MOD = 998244353;
char S[3005], T[3005];
long long dp[3005][3005];
int n, m;
int main() {
  scanf("%s %s", S, T);
  n = strlen(S);
  m = strlen(T);
  dp[n][0] = 1;
  for (int i = n - 1; i >= 1; --i) {
    for (int j = 0; j <= m; ++j) {
      if (j == 0) {
        if (i >= m)
          dp[i][j] = n - i + 1;
        else if (S[i] == T[i]) {
          dp[i][j] = dp[i + 1][j];
        }
      } else if (j < m) {
        if (i + j >= m || S[i] == T[i + j]) {
          dp[i][j] = dp[i + 1][j];
        }
        if (S[i] == T[j - 1]) {
          dp[i][j] = (dp[i][j] + dp[i + 1][j - 1]) % MOD;
        }
      } else {
        dp[i][j] = (dp[i + 1][m] * 2) % MOD;
        if (S[i] == T[m - 1]) {
          dp[i][j] = (dp[i][j] + dp[i + 1][j - 1]) % MOD;
        }
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    if (T[i] == S[0]) {
      ans = (ans + dp[1][i]) % MOD;
    }
  }
  ans = (ans + dp[1][m]) * 2 % MOD;
  printf("%lld", ans);
}
