#include <bits/stdc++.h>
using namespace std;
const long long INF(0x3f3f3f3f3f3f3f3fll);
const long long inf(0x3f3f3f3f);
namespace Polynomial {
const long long P = 998244353, g = 3, gi = 332748118;
static long long rev[1000];
long long lim, bit;
long long add(long long a, long long b) { return (a += b) >= P ? a - P : a; }
long long qpow(long long a, long long b) {
  long long prod = 1;
  while (b) {
    if (b & 1) prod = prod * a % P;
    a = a * a % P;
    b >>= 1;
  }
  return (prod + P) % P;
}
void calrev() {
  for (long long i = 1; i < lim; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (bit - 1));
}
void NTT(long long *A, long long inv) {
  for (long long i = 0; i < lim; i++)
    if (i < rev[i]) swap(A[i], A[rev[i]]);
  for (long long mid = 1; mid < lim; mid <<= 1) {
    long long tmp = qpow(inv == 1 ? g : gi, (P - 1) / (mid << 1));
    for (long long j = 0; j < lim; j += (mid << 1)) {
      long long omega = 1;
      for (long long k = 0; k < mid; k++, omega = (omega * tmp) % P) {
        long long x = A[j + k], y = omega * A[j + k + mid] % P;
        A[j + k] = (x + y) % P;
        A[j + k + mid] = (x - y + P) % P;
      }
    }
  }
  if (inv == 1) return;
  long long invn = qpow(lim, P - 2);
  for (long long i = 0; i < lim; i++) A[i] = A[i] * invn % P;
}
static long long x[1000], y[1000];
void mul(long long *a, long long *b) {
  memset(x, 0, sizeof x);
  memset(y, 0, sizeof y);
  for (long long i = 0; i < (lim >> 1); i++) x[i] = a[i], y[i] = b[i];
  NTT(x, 1), NTT(y, 1);
  for (long long i = 0; i < lim; i++) x[i] = x[i] * y[i] % P;
  NTT(x, -1);
  for (long long i = 0; i < lim; i++) a[i] = x[i];
}
static long long c[2][1000];
void Inv(long long *a, long long n) {
  long long p = 0;
  memset(c, 0, sizeof c);
  c[0][0] = qpow(a[0], P - 2);
  lim = 2, bit = 1;
  while (lim <= (n << 1)) {
    lim <<= 1, bit++;
    calrev();
    p ^= 1;
    memset(c[p], 0, sizeof c[p]);
    for (long long i = 0; i <= lim; i++)
      c[p][i] = add(c[p ^ 1][i], c[p ^ 1][i]);
    mul(c[p ^ 1], c[p ^ 1]);
    mul(c[p ^ 1], a);
    for (long long i = 0; i <= lim; i++)
      c[p][i] = add(c[p][i], P - c[p ^ 1][i]);
  }
  for (long long i = 0; i < lim; i++) a[i] = c[p][i];
}
}  // namespace Polynomial
using namespace Polynomial;
inline char fgc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long readint() {
  register long long res = 0, neg = 1;
  char c = fgc();
  while (c < '0' || c > '9') {
    if (c == '-') neg = -1;
    c = fgc();
  }
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0';
    c = fgc();
  }
  return res * neg;
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  long long r = exgcd(b, a % b, y, x);
  y -= a / b * x;
}
long long phi(long long n) {
  long long ans = n, temp = n, i;
  for (i = 2; i * i <= temp; i++) {
    if (temp % i == 0) {
      ans -= ans / i;
      while (temp % i == 0) temp /= i;
    }
  }
  if (temp > 1) ans -= ans / temp;
  return ans;
}
struct vec {
  double x, y;
  vec(double X = 0, double Y = 0) : x(X), y(Y) {}
  vec operator+(const vec &a) const { return vec(x + a.x, y + a.y); }
  vec operator-(const vec &a) const { return vec(x - a.x, y - a.y); }
  void operator+=(const vec &a) { this->x += a.x, this->y += a.y; }
  void operator-=(const vec &a) { this->x -= a.x, this->y -= a.y; }
  vec operator*(const double &a) const { return vec(x * a, y * a); }
  vec operator/(const double &a) const { return vec(x / a, y / a); }
  void operator*=(const double &a) { this->x *= a, this->y *= a; }
  void operator/=(const double &a) { this->x /= a, this->y /= a; }
};
struct Trie {
  long long next[500010][26], fail[500010], end[500010];
  long long root, L;
  long long newnode() {
    for (long long i = 0; i < 26; i++) next[L][i] = -1;
    end[L++] = 0;
    return L - 1;
  }
  void init() {
    L = 0;
    root = newnode();
  }
  void insert(char buf[]) {
    long long len = (long long)strlen(buf);
    long long now = root;
    for (long long i = 0; i < len; i++) {
      if (next[now][buf[i] - 'a'] == -1) {
        next[now][buf[i] - 'a'] = newnode();
      }
      now = next[now][buf[i] - 'a'];
    }
    end[now]++;
  }
  void build() {
    queue<long long> Q;
    fail[root] = root;
    for (long long i = 0; i < 26; i++) {
      if (next[root][i] == -1) {
        next[root][i] = root;
      } else {
        fail[next[root][i]] = root;
        Q.push(next[root][i]);
      }
    }
    while (!Q.empty()) {
      long long now = Q.front();
      Q.pop();
      for (long long i = 0; i < 26; i++) {
        if (next[now][i] == -1)
          next[now][i] = next[fail[now]][i];
        else {
          fail[next[now][i]] = next[fail[now]][i];
          Q.push(next[now][i]);
        }
      }
    }
  }
  long long query(char buf[]) {
    long long len = (long long)strlen(buf);
    long long now = root;
    long long res = 0;
    for (long long i = 0; i < len; i++) {
      now = next[now][buf[i] - 'a'];
      long long temp = now;
      while (temp != root) {
        res += end[temp];
        end[temp] = 0;
        temp = fail[temp];
      }
    }
    return res;
  }
};
char buf[1000010];
Trie ac;
struct NOODD {
  double x;
  double y;
  NOODD(double a, double b) { x = a, y = b; }
  NOODD() {}
};
NOODD operator+(NOODD A, NOODD B) { return NOODD(A.x + B.x, A.y + B.y); }
NOODD operator*(NOODD A, double p) { return NOODD(A.x * p, A.y * p); }
NOODD operator/(NOODD A, double p) { return NOODD(A.x / p, A.y * p); }
double Dot(NOODD A, NOODD B) { return A.x * B.x + A.y * B.y; }
double Length(NOODD A) { return sqrt(Dot(A, A)); }
double Angle(NOODD A, NOODD B) {
  return acos(Dot(A, B) / Length(A) / Length(B));
}
double Cross(NOODD A, NOODD B) { return A.x * B.y - A.y * B.x; }
NOODD Rotate(NOODD A, double rad) {
  return NOODD(A.x * cos(rad) - A.y * sin(rad),
               A.x * sin(rad) + A.y * cos(rad));
}
void extend_Euclid(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return;
  }
  extend_Euclid(b, a % b, x, y);
  long long tmp = x;
  x = y;
  y = tmp - (a / b) * y;
}
long long CRT(long long a[], long long m[], long long n) {
  long long M = 1;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) M *= m[i];
  for (long long i = 1; i <= n; i++) {
    long long x, y;
    long long Mi = M / m[i];
    extend_Euclid(Mi, m[i], x, y);
    ans = (ans + Mi * x * a[i]) % M;
  }
  if (ans < 0) ans += M;
  return ans;
}
const long long mod = 998244353;
const long long N = 3e3 + 10;
;
long long len1, len2;
char s[N], t[N];
long long dp[N][N];
void solve(long long i, long long j) {
  long long len = j - i + 1;
  char c = s[len + 1];
  if (i >= 2) {
    if (i - 1 <= len2) {
      if (c == t[i - 1]) dp[i - 1][j] += dp[i][j], dp[i - 1][j] %= mod;
    } else
      dp[i - 1][j] += dp[i][j], dp[i - 1][j] %= mod;
  }
  if (j + 1 <= len1) {
    if (j + 1 <= len2) {
      if (c == t[j + 1]) dp[i][j + 1] += dp[i][j], dp[i][j + 1] %= mod;
    } else
      dp[i][j + 1] += dp[i][j], dp[i][j + 1] %= mod;
  }
}
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  ;
  cin >> s + 1 >> t + 1;
  len1 = strlen(s + 1);
  len2 = strlen(t + 1);
  for (long long i = 1; i <= len1; i++) {
    char c = s[1];
    if (i <= len2) {
      if (c == t[i]) dp[i][i] = 2;
    } else
      dp[i][i] = 2;
  }
  for (long long len = 1; len <= len1 - 1; len++)
    for (long long i = 1; i <= len1; i++) {
      long long j = i + len - 1;
      if (j > len1) break;
      solve(i, j);
    }
  long long ans = 0;
  for (long long i = len2; i <= len1; i++) ans = (ans + dp[1][i]) % mod;
  cout << ans << '\n';
  return 0;
}
