#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MAXN = 1e6 + 5;
const int mod = 998244353;
int dp[3005][3005], len1, len2;
string s, t;
bool check(int i, char c) {
  if (i > len2 || c == t[i - 1]) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> s >> t;
  len1 = s.size(), len2 = t.size();
  for (int i = 1; i <= len1 + 1; i++) {
    dp[i][i - 1] = 1;
  }
  for (int i = 1; i <= len1; i++) {
    char c = s[i - 1];
    for (int j = 1, k = i; k <= len1; k++, j++) {
      if (check(j, c)) dp[j][k] = (dp[j][k] + dp[j + 1][k]) % mod;
      if (check(k, c)) dp[j][k] = (dp[j][k] + dp[j][k - 1]) % mod;
    }
  }
  int ans = 0;
  for (int i = len2; i <= len1; i++) ans += dp[1][i], ans %= mod;
  cout << ans << endl;
  return 0;
}
