#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5, INF = int(1e9), mod = 998244353;
const long long BIG = 1e18;
string s, t;
int n, m, dp[N][N];
bool w[N][N];
void add(int &a, int b) {
  a += b - mod;
  if (a < 0) a += mod;
}
int rec(int v, int pos) {
  if (v < 1) {
    return 1;
  }
  if (w[v][pos]) return dp[v][pos];
  int ans = 0;
  if (pos > m or s[v] == t[pos]) {
    add(ans, rec(v - 1, pos + 1));
  }
  int x = pos + v - 1;
  if (x > m or s[v] == t[x]) {
    add(ans, rec(v - 1, pos));
  }
  w[v][pos] = 1;
  return dp[v][pos] = ans;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s >> t;
  n = (int)s.size();
  m = (int)t.size();
  t = '!' + t;
  s = '!' + s;
  int ans = 0;
  for (int i = n; i >= m; i--) {
    add(ans, rec(i, 1));
  }
  cout << ans;
}
