#include <bits/stdc++.h>
using namespace std;
const long long N = 3000 + 3;
const long long mod = 998244353;
long long dp[N][N];
long long power(long long x, long long y) {
  x %= mod;
  if (x < 0) x += mod;
  x %= mod;
  long long ans = 1;
  while (y) {
    if (y & 1) {
      ans = (ans * x) % mod;
    }
    y >>= 1;
    x = (x * x) % mod;
  }
  return ans;
}
int solve() {
  string s;
  cin >> s;
  string t;
  cin >> t;
  long long n = (long long int)s.size();
  long long m = (long long int)t.size();
  for (long long int i = 0; i < n; i++) {
    for (long long int j = m - 1; j > -1; j--) {
      if (i == 0)
        dp[i][j] = (s[0] == t[j]);
      else if (j == m - 1)
        dp[i][j] = (dp[i - 1][j] + (s[i] == t[j] ? power(2, i - 1) : 0)) % mod;
      else
        dp[i][j] = ((i >= m - j || s[i] == t[j + i] ? dp[i - 1][j] : 0) +
                    (s[i] == t[j] ? dp[i - 1][j + 1] : 0)) %
                   mod;
    }
  }
  long long ans = 0;
  for (long long int i = m - 1; i < n; i++) ans = (ans + dp[i][0]) % mod;
  ans *= 2;
  ans %= mod;
  cout << ans << "\n";
  return 0;
}
int main() {
  auto start = chrono::high_resolution_clock::now();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test_cases = 1;
  while (test_cases--) solve();
  auto stop = chrono::high_resolution_clock::now();
  auto duration = chrono::duration_cast<chrono::milliseconds>(stop - start);
}
