#include <bits/stdc++.h>
using namespace std;
const int maxn = 3001;
const long long mod = 998244353;
long long f[maxn][maxn];
bool _d[maxn][maxn];
char a[maxn], b[maxn];
int n, m;
long long tt[maxn];
long long st[maxn];
void enter() {
  string A, B;
  cin >> A >> B;
  n = int(A.size());
  m = int(B.size());
  for (int i = (1), _b = (n + 1); i < _b; ++i) a[i] = A[i - 1];
  for (int i = (1), _b = (m + 1); i < _b; ++i) b[i] = B[i - 1];
  tt[0] = 1;
  tt[1] = 1;
  for (int i = (2), _b = (n + 1); i < _b; ++i) tt[i] = (tt[i - 1] * 2) % mod;
  st[0] = 1;
  for (int i = (1), _b = (n + 1); i < _b; ++i)
    st[i] = (st[i - 1] + tt[i]) % mod;
}
long long qhd(int l, int _u) {
  if (_u == 0) return 1;
  if (_d[l][_u])
    return f[l][_u];
  else {
    f[l][_u] = 0;
    if (l <= m) {
      if (b[l] == a[_u]) f[l][_u] += qhd(l + 1, _u - 1);
    } else
      f[l][_u] += qhd(l + 1, _u - 1);
    f[l][_u] = f[l][_u] % mod;
    if (l + _u - 1 <= m) {
      if (b[l + _u - 1] == a[_u]) f[l][_u] += qhd(l, _u - 1);
    } else
      f[l][_u] += qhd(l, _u - 1);
    f[l][_u] = f[l][_u] % mod;
    _d[l][_u] = true;
    return f[l][_u];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  enter();
  long long sum = 0;
  for (int i = (1), _b = (n + 1); i < _b; ++i)
    if (i >= m) {
      sum += qhd(1, i);
      sum = sum % mod;
    }
  cout << sum;
}
