#include <bits/stdc++.h>
using namespace std;
string T;
const int MOD = 998244353;
const int nax = 3001;
int dp[2 * nax][2 * nax];
void add_self(int& a, int b) {
  a += b;
  if (a >= MOD) {
    a -= MOD;
  }
}
int main(int argc, char* argv[]) {
  string S, T;
  cin >> S >> T;
  const int n = S.size();
  const int m = T.size();
  for (int i = 0; i < m; i++) {
    if (S[0] == T[i]) {
      dp[i][i] = 2;
    }
  }
  for (int i = m; i <= n + m; i++) {
    dp[i][i] = 2;
  }
  for (int i = 1; i < n; i++) {
    char c = S[i];
    for (int L = 0;; L++) {
      int R = L + i - 1;
      if (R >= n + m) break;
      if (L > m || T[L - 1] == c) add_self(dp[L - 1][R], dp[L][R]);
      if (R >= m - 1 || T[R + 1] == c) add_self(dp[L][R + 1], dp[L][R]);
    }
  }
  int res = 0;
  for (int i = m - 1; i <= n + m; i++) {
    add_self(res, dp[0][i]);
  }
  cout << res << '\n';
  return 0;
}
