#include <bits/stdc++.h>
using namespace std;
void pr(long long x, bool fl = false) {
  cout << x << endl;
  if (fl) exit(0);
}
void pr(long long x, long long y, bool fl = false) {
  cout << x << " " << y << endl;
  if (fl) exit(0);
}
const long long mod = 998244353;
const long long inf = LLONG_MAX;
const long long minf = LLONG_MIN;
const long long maxn = 3000;
const long long maxc = 26;
void chkmax(long long &_max, long long x) { _max = max(_max, x); }
void chkmin(long long &_min, long long x) { _min = min(_min, x); }
void modadd(long long &now, long long x, long long p = mod) {
  while (now < 0) now += p;
  x %= p;
  now %= p;
  now += x;
  now %= p;
  while (now < 0) now += p;
}
void modmul(long long &now, long long x, long long p = mod) {
  while (now < 0) now += p;
  x %= p;
  now %= p;
  now *= x;
  now %= p;
  while (now < 0) now += p;
}
long long qpow(long long a, long long b, long long p = mod) {
  long long ans = 1;
  a %= p;
  while (b) {
    if (b & 1) ans *= a;
    a *= a;
    ans %= p;
    a %= p;
    b /= 2;
  }
  return ans;
}
long long inv(long long a, long long p = mod) { return qpow(a % p, p - 2, p); }
long long c, xx, y, z, n, m, q, k, l, r, u, v, w, tmp, nxt, rt, cur, dis;
long long ans, val, flag, cnt;
long long f[maxn + 5][maxn + 5], x[maxn + 5];
signed main() {
  ios::sync_with_stdio(false);
  long long test_case = 1;
  while (test_case--) {
    string s, t;
    cin >> s >> t;
    long long ns = s.length(), nt = t.length();
    s = "0" + s;
    t = "0" + t;
    for (long long j = 1; j <= nt; j++) f[j][j] = (t[j] == s[1]) ? 2 : 0;
    for (long long j = nt + 1; j <= ns; j++) f[j][j] = 2;
    for (long long k = 2; k <= ns; k++) {
      for (long long i = 1; i <= ns - k + 1; i++) {
        long long j = i + k - 1;
        if (j > nt)
          modadd(f[i][j], f[i][j - 1]);
        else if (s[k] == t[j])
          modadd(f[i][j], f[i][j - 1]);
        if (i > nt)
          modadd(f[i][j], f[i + 1][j]);
        else if (s[k] == t[i])
          modadd(f[i][j], f[i + 1][j]);
      }
    }
    long long ans = 0;
    for (long long i = nt; i <= ns; i++) modadd(ans, f[1][i]);
    pr(ans);
  }
}
