#include <bits/stdc++.h>
using namespace std;
const int N = 3000 + 10;
const int mod = 998244353;
int add(int a, int b) { return (a += b) >= mod ? a - mod : a; }
int mul(long long a, int b) { return a * b % mod; }
int dp[N][N];
char s[N], t[N];
int main(void) {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int m = strlen(s + 1);
  int n = strlen(t + 1);
  for (int i = 1; i <= m; i++)
    if (s[1] == t[i] || i > n) dp[i][i] = 2;
  for (int l = 2; l <= m; l++) {
    for (int i = 1, j; i + l - 1 <= m; i++) {
      j = i + l - 1;
      if (s[l] == t[i] || i > n) dp[i][j] = add(dp[i][j], dp[i + 1][j]);
      if (s[l] == t[j] || j > n) dp[i][j] = add(dp[i][j], dp[i][j - 1]);
    }
  }
  int ans = 0;
  for (int i = n; i <= m; i++) ans = add(ans, dp[1][i]);
  printf("%d\n", ans);
}
