#include <bits/stdc++.h>
using namespace std;
const long long int ll_MAX = 6922337203685999999;
const long long int MOD = 998244353;
long long int fast_expo(long long int x, long long int p) {
  if (p == 0)
    return 1;
  else if (p % 2 == 0) {
    long long int t = fast_expo(x, p / 2) % MOD;
    return (t * t) % MOD;
  } else
    return (x * (fast_expo(x, p - 1)) % MOD) % MOD;
}
string s1, s2;
long long int dp[3005][3005];
long long int find(long long int i, long long int j) {
  if (i == j && (s2[i] == s1[0] || s2[i] == '*')) return 2;
  if (dp[i][j] != -1) return dp[i][j];
  long long int ans = 0;
  if (s2[j] == s1[j - i] || s2[j] == '*') ans += find(i, j - 1);
  if (s2[i] == s1[j - i] || s2[i] == '*') ans += find(i + 1, j);
  ans %= MOD;
  return dp[i][j] = ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int t_c;
  t_c = 1;
  for (long long int t_i = 0; t_i < t_c; ++t_i) {
    memset(dp, -1, sizeof(dp));
    cin >> s1 >> s2;
    long long int n = s1.size(), m = s2.size();
    for (long long int i = m; i < n; ++i) s2.push_back('*');
    long long int tot = 0;
    for (long long int i = m - 1; i < n; i++) {
      tot += max(0ll, find(0, i));
    }
    tot %= MOD;
    cout << tot << "\n";
  }
  return 0;
}
