#include <bits/stdc++.h>
using namespace std;
long long dp[3005][3005];
string s, t;
int n, m;
inline long long solve(int l, int r) {
  int id = r - l + 1;
  if (r >= n) return 0ll;
  if (l == 0) {
    for (int i = r + 1; i < m; i++) {
      if (t[i] != s[id]) return 0ll;
      id++;
    }
    return 1ll * (n - id + 1ll);
  }
  long long &ret = dp[l][r];
  if (ret != -1ll) return ret;
  ret = 0ll;
  if (r + 1 < m) {
    if (s[id] == t[r + 1]) ret = (ret + solve(l, r + 1)) % 998244353;
  } else
    ret = (ret + solve(l, r + 1)) % 998244353;
  if (l - 1 < m) {
    if (s[id] == t[l - 1]) ret = (ret + solve(l - 1, r)) % 998244353;
  } else
    ret = (ret + solve(l - 1, r)) % 998244353;
  return ret;
}
int main() {
  memset((dp), (-1), sizeof((dp)));
  ;
  cin >> s >> t;
  n = s.length();
  m = t.length();
  long long ans = 0ll;
  for (int i = 0; i < n; i++) {
    if (i < m && t[i] == s[0]) {
      ans = (ans + 2 * solve(i, i)) % 998244353;
    } else if (i >= m) {
      ans = (ans + 2 * solve(i, i)) % 998244353;
    }
  }
  printf("%lld\n", ans);
  ;
  return 0;
}
