#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int MAX_N = 3000 + 5;
const int MAX_L = 20;
const long long MOD = 998244353;
string s, t;
int dp[MAX_N][MAX_N];
int dfs(int pos, int len) {
  if (len == 1) {
    if (t[pos] == '#' || t[pos] == s[len - 1])
      return 2;
    else
      return 0;
  }
  if (dp[pos][len] != -1) return dp[pos][len];
  dp[pos][len] = 0;
  int cur = pos + len - 1;
  if (t[cur] == '#' || t[cur] == s[len - 1]) dp[pos][len] += dfs(pos, len - 1);
  if (t[pos] == '#' || t[pos] == s[len - 1])
    dp[pos][len] += dfs(pos + 1, len - 1);
  return dp[pos][len] %= MOD;
}
void solve() {
  cin >> s >> t;
  int n = s.size(), m = t.size();
  for (int i = m; i < n; i++) t += "#";
  memset(dp, -1, sizeof dp);
  int ans = 0;
  for (int i = m; i <= n; i++) {
    ans += dfs(0, i);
    ans %= MOD;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
