#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
const int mod = 998244353;
long long dp[N][N], ans = 0ll;
char s[N], t[N];
int main() {
  scanf("%s%s", s + 1, t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  for (int i = 1; i <= m; ++i) {
    if (t[i] == s[1]) dp[i][i] = 2ll;
  }
  for (int i = m + 1; i <= n; ++i) dp[i][i] = 2ll;
  for (int i = 2; i <= n; ++i) {
    for (int l = 1; l + i - 1 <= n; ++l) {
      int r = l + i - 1;
      if (s[i] == t[l] || l > m) dp[l][r] = (dp[l][r] + dp[l + 1][r]) % mod;
      if (s[i] == t[r] || r > m) dp[l][r] = (dp[l][r] + dp[l][r - 1]) % mod;
    }
  }
  for (int i = m; i <= n; ++i) {
    ans += dp[1][i];
    ans %= mod;
  }
  printf("%lld\n", ans);
  return 0;
}
