#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3005, mod = 998244353;
long long dp[maxn][maxn];
long long extra[maxn], hold[maxn], p[maxn];
long long n, m;
char s[maxn], t[maxn];
void read() {
  scanf("%s\n%s", &s, &t);
  n = (long long)strlen(s);
  m = (long long)strlen(t);
  for (long long i = n; i >= 1; i--) s[i] = s[i - 1];
  for (long long i = m; i >= 1; i--) t[i] = t[i - 1];
  return;
}
long long add(long long x, long long y) {
  if (x + y >= mod) return x + y - mod;
  return x + y;
}
int main() {
  read();
  long long ans = 0;
  dp[0][0] = p[0] = 1;
  for (long long i = 1; i <= n; i++) p[i] = add(p[i - 1], p[i - 1]);
  for (long long i = 1; i <= m; i++) extra[i] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= min(i, m); j++) {
      if (j == 0) {
        dp[i][j] = p[i];
        continue;
      }
      dp[i][j] = add(dp[i][j], dp[i - 1][j]);
      if (s[i] == t[m - j + 1]) {
        dp[i][j] = add(dp[i][j], dp[i - 1][j - 1]);
      }
      if (i == j && s[i] == t[m]) {
        dp[i][j] = add(dp[i][j], extra[m - j + 1]);
      }
      if (j == m) {
        ans = add(ans, dp[i][j]);
      }
    }
    if (i <= m) {
      if (i == 1) {
        for (long long j = 1; j <= m; j++) extra[j] = (t[j] == s[1] ? 2 : 0);
      } else {
        for (long long j = 1; j <= m; j++)
          if (t[j] == s[i]) {
            hold[j] = add(hold[j], extra[j + 1]);
            if (j >= i)
              hold[j - i + 1] = add(hold[j - i + 1], extra[j - i + 1]);
          }
        for (long long j = 1; j <= m; j++) {
          extra[j] = hold[j];
          hold[j] = 0;
        }
      }
    }
  }
  printf("%lld", ans);
  return 0;
}
