#include <bits/stdc++.h>
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
constexpr long long mod = 1e9 + 7;
constexpr long long Mod = 998244353;
constexpr long long MXN = 500000 + 100;
constexpr ld EPS = 1e-10;
constexpr ll inf = 3 * 1e18;
constexpr long long Inf = 15 * 1e8;
const vector<long long> dx{-1, 1, 0, 0}, dy{0, 0, -1, 1};
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
ll read() {
  ll u, k = scanf("%lld", &u);
  return u;
}
string reads() {
  string s;
  cin >> s;
  return s;
}
pair<long long, long long> readh(bool g = 0) {
  pair<long long, long long> u;
  long long k = scanf("%lld %lld", &u.first, &u.second);
  if (g) u.first--, u.second--;
  return u;
}
void printh(pair<long long, long long> t) {
  printf("%lld %lld\n", t.first, t.second);
}
bool inarea(pair<long long, long long> t, long long h, long long w) {
  return 0 <= t.first && t.first < h && 0 <= t.second && t.second < w;
}
ll gcd(ll i, ll j) { return j ? gcd(j, i % j) : i; }
ll lcm(ll i, ll j) { return i / gcd(i, j) * j; }
ll mod_pow(ll x, ll n, ll p = mod) {
  ll res = 1;
  x %= p;
  while (n > 0) {
    if (n & 1) res = res * x % p;
    x = x * x % p;
    n >>= 1;
  }
  return res;
}
ll bitcount(ll x) {
  long long sum = 0;
  for (long long i = 0; i < 60; i++)
    if ((1ll << i) & x) sum++;
  return sum;
}
long long dp[4000][4000];
signed main() {
  string s, t;
  cin >> s >> t;
  long long n = s.size(), m = t.size();
  for (long long i = 0; i < n; i++) {
    if (i < m) {
      if (t[i] == s[0]) {
        dp[i][i] = 2;
      }
    } else {
      dp[i][i] = 2;
    }
  }
  for (long long l = 2; l <= n; l++) {
    for (long long i = 0; i < n; i++) {
      long long j = i + l - 1;
      if (j >= n) break;
      if (j < m) {
        if (t[j] == s[l - 1]) {
          dp[i][j] += dp[i][j - 1];
        }
      } else {
        dp[i][j] += dp[i][j - 1];
      }
      if (i < m) {
        if (t[i] == s[l - 1]) {
          dp[i][j] += dp[i + 1][j];
        }
      } else {
        dp[i][j] += dp[i + 1][j];
      }
      dp[i][j] %= Mod;
    }
  }
  long long res = 0;
  for (long long(i) = (m - 1); (i) < (n); (i)++) {
    (res += dp[0][i]) %= Mod;
  }
  cout << res << endl;
}
