#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3010;
const int MOD = 998244353;
int f[MAXN][MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string p, q;
  cin >> p >> q;
  int n = p.size(), m = q.size();
  for (int i = 0; i < m; ++i) {
    if (p[0] == q[i]) f[0][i] = 2;
  }
  f[0][m] = 2;
  int ans = 0;
  if (m == 1) ans = f[0][0];
  for (int i = 0; i + 1 < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (j > 0 && q[j - 1] == p[i + 1]) {
        f[i + 1][j - 1] = (f[i + 1][j - 1] + f[i][j]) % MOD;
      }
      if (j + i + 1 >= m || q[j + i + 1] == p[i + 1]) {
        f[i + 1][j] = (f[i + 1][j] + f[i][j]) % MOD;
      }
    }
    if (q[m - 1] == p[i + 1]) {
      f[i + 1][m - 1] = (f[i + 1][m - 1] + f[i][m]) % MOD;
    }
    f[i + 1][m] = (f[i][m] + f[i][m]) % MOD;
    if (i + 2 >= m) {
      ans = (ans + f[i + 1][0]) % MOD;
    }
  }
  cout << ans << endl;
  return 0;
}
