#include <bits/stdc++.h>
using namespace std;
const int N = 3001;
int n, m, dp[N][N], pow2[N], mod = 998244353;
string s, t;
int solve(int l, int r, int b) {
  int la = l + 1;
  int ra = b - r + 1;
  if (la < ra) return 0;
  if (ra == 0) return pow2[la];
  int &ret = dp[l][r];
  if (ret != -1) return ret;
  ret = 0;
  if (ra > 0 && s[l] == t[r]) {
    ret += solve(l - 1, r + 1, b);
    if (ret >= mod) ret -= mod;
  }
  if (la > ra) {
    ret += solve(l - 1, r, b);
    if (ret >= mod) ret -= mod;
  } else {
    if (ra > 0 && s[l] == t[b]) {
      ret += solve(l - 1, r, b - 1);
      if (ret >= mod) ret -= mod;
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  pow2[0] = 1;
  for (int i = 1; i < N; i++) {
    pow2[i] = 2 * pow2[i - 1] % mod;
  }
  memset(dp, -1, sizeof dp);
  cin >> s >> t;
  n = s.size();
  m = t.size();
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += solve(i, 0, m - 1);
    if (ans >= mod) ans -= mod;
  }
  cout << ans << endl;
}
