#include <bits/stdc++.h>
const int N = 3e3 + 7;
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char s[N], t[N];
long long dp[N][N];
int n, m;
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int n = strlen(s + 1);
  int m = strlen(t + 1);
  for (int i = 1; i <= n; i++) {
    if (i <= m) {
      if (s[1] == t[i]) dp[i][i] = 2;
    } else
      dp[i][i] = 2;
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j + i - 1 <= n; j++) {
      int l = j, r = j + i - 1;
      if (l <= m && s[i] == t[l])
        dp[l][r] = (dp[l + 1][r] + dp[l][r]) % 998244353;
      else if (l > m)
        dp[l][r] = (dp[l + 1][r] + dp[l][r]) % 998244353;
      if (r <= m && s[i] == t[r])
        dp[l][r] = (dp[l][r - 1] + dp[l][r]) % 998244353;
      else if (r > m)
        dp[l][r] = (dp[l][r - 1] + dp[l][r]) % 998244353;
    }
  }
  long long res = 0;
  for (int i = m; i <= n; i++) res = (res + dp[1][i]) % 998244353;
  cout << res << "\n";
}
