#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const long long p = 998244353;
long long dp[3010][3010];
char s[3010], t[3010];
long long power(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % p;
    x = x * x % p;
    y >>= 1;
  }
  return res;
}
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int len1 = strlen(s + 1), len2 = strlen(t + 1);
  long long sum = 0;
  for (int i = len2 + 1; i <= len1 + 1; i++) dp[i][0] = 1;
  for (int i = len1; i >= 1; i--) {
    for (int j = 0; j < len2; j++) {
      if (s[i] == t[j + 1]) dp[i][j + 1] = (dp[i][j + 1] + dp[i + 1][j]) % p;
      if (i + j > len2 || s[i] == t[i + j])
        dp[i][j] = (dp[i][j] + dp[i + 1][j]) % p;
    }
    sum = (sum + dp[i][len2] * power(2, i - 1) % p) % p;
  }
  for (int i = 0; i < len2; i++) sum = (sum + dp[1][i]) % p;
  printf("%lld\n", sum);
}
