#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 7, INF = 2e9 + 1, mod = 998244353;
const double PI = 3.141592653589793238462643383279502884197, eps = 1e-6;
string s, t;
int sz, sum;
long long dp[N][N];
int solve(int ind, int fr, int bc) {
  if (ind == sz) return 1;
  long long &res = dp[fr][bc];
  if (res != -1) return res;
  int diff = min((int)t.size() - 1, bc) - fr + 1;
  long long p3 = 0, p1 = 0, p2 = 0;
  if (fr > bc || fr >= (int)t.size()) {
    res = solve(ind + 1, fr, bc);
    if (ind < sz - 1) res = (res * 2) % mod;
    return res;
  }
  if (s[ind] == t[fr]) p1 = solve(ind + 1, fr + 1, bc);
  if (sz - ind - 1 >= diff)
    p3 = solve(ind + 1, fr, bc - 1),
    sum = (sum + p3 * (p3 > 0 && fr == 0 && bc >= (int)t.size() - 1)) % mod;
  else if (s[ind] == t[bc] && ind != sz - 1)
    p2 = solve(ind + 1, fr, bc - 1);
  return res = (p1 + p2 + p3) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long ans;
  cin >> s >> t;
  sz = s.size();
  reverse(s.begin(), s.end());
  memset(dp, -1, sizeof dp);
  ans = solve(0, 0, sz - 1) + sum;
  cout << (ans * 2) % mod;
  return 0;
}
