#include <bits/stdc++.h>
using namespace std;
long long dp[3001][3000];
int main() {
  long long i, j, k;
  long long n, m;
  string str, pre;
  cin >> str >> pre;
  n = str.length();
  m = pre.length();
  dp[n][0] = 1;
  for (i = n - 1; i > 0; i--) {
    for (j = 0; j + i <= n; j++) {
      k = j + i - 1;
      if (j > 0 && (j > m || str[i] == pre[j - 1]))
        dp[i][j] = (dp[i][j] + dp[i + 1][j - 1]) % 998244353;
      if (k < n - 1 && (k >= m - 1 || str[i] == pre[k + 1]))
        dp[i][j] = (dp[i][j] + dp[i + 1][j]) % 998244353;
      if (j == 0 && i >= m) dp[i][j]++;
    }
  }
  long long res = 0;
  for (i = 0; i < n; i++)
    if (i >= m || str[0] == pre[i]) res = (res + 2ll * dp[1][i]) % 998244353;
  printf("%lld", res);
}
