#include <bits/stdc++.h>
using namespace std;
const int MAXn = 3000 + 2, MOD = 998244353;
int n, m;
string s, t;
int dp[MAXn][MAXn];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s >> t;
  n = s.size(), m = t.size();
  dp[n][0] = 1;
  for (int i = n - 1; i >= 1; --i) {
    for (int j = 0; j <= m; j++) {
      dp[i][j] = j == 0 && i >= m;
      if (j && t[j - 1] == s[i]) dp[i][j] += dp[i + 1][j - 1];
      if (j + i >= m || t[j + i] == s[i]) dp[i][j] += dp[i + 1][j];
      dp[i][j] %= MOD;
    }
    dp[i][m] = (dp[i][m] + dp[i + 1][m]) % MOD;
  }
  int ans = dp[1][m];
  for (int i = 0; i < (m); i++)
    if (t[i] == s[0]) ans = (ans + dp[1][i]) % MOD;
  ans = ans * 2 % MOD;
  cout << ans << endl;
  return 0;
}
