#include <bits/stdc++.h>
const long long int MOD = 998244353;
const long long int INF = 1011111111;
const long long int LLINF = 1000111000111000111LL;
const long double EPS = 1e-10;
const long double PI = 3.14159265358979323;
using namespace std;
long long int power(long long int base, long long int exponent) {
  long long int ans = 1;
  while (exponent != 0) {
    if (exponent & 1) ans = (1LL * ans * base);
    base = (1LL * base * base);
    exponent >>= 1;
  }
  return ans;
}
const long long int N = 3005;
long long int dp[N][N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, i, j, k;
  string s, t;
  cin >> s >> t;
  n = s.length();
  m = t.length();
  k = m;
  while (m != n) {
    t += "$";
    m += 1;
  }
  for (i = 0; i < m; i++) {
    if (t[i] == s[0] || t[i] == '$') dp[i][i] = 1;
  }
  for (long long int block = 2; block <= n; block++) {
    for (long long int l = 0; l < n; l++) {
      long long int r = l + block - 1;
      if (r >= n) break;
      if (s[block - 1] == t[l] || t[l] == '$') dp[l][r] += dp[l + 1][r];
      if (s[block - 1] == t[r] || t[r] == '$') dp[l][r] += dp[l][r - 1];
      dp[l][r] %= MOD;
    }
  }
  long long int ans = 0;
  for (i = k - 1; i < n; i++) {
    ans += dp[0][i];
    ans %= MOD;
  }
  ans *= 2ll;
  ans %= MOD;
  cout << ans;
  cerr << '\n'
       << "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
}
