#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const long long inf64 = ((long long)1 << 62) - 1;
const long double pi = acos(-1);
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T abs(T x) {
  return x < 0 ? -x : x;
}
const int P = 998244353;
int Sum(int a, int b) { return (a + b) % P; }
int Mult(int a, int b) { return (a * (long long)b) % P; }
int main() {
  ios_base::sync_with_stdio(0);
  string s, t;
  cin >> s >> t;
  int n = ((int)(s).size());
  int m = ((int)(t).size());
  vector<vector<int>> ds(m, vector<int>(m, 0));
  vector<int> d0(m);
  for (int i = 0; i < m; ++i) {
    ds[i][i] = 1;
  }
  d0[0] = (s[0] == t[m - 1]);
  for (int i = 0; i < m - 1; ++i) {
    for (int j = 0; j + i + 1 < m; ++j) {
      int je = j + i + 1;
      if (s[i] == t[j]) {
        ds[j][je] = Sum(ds[j][je], ds[j + 1][je]);
      }
      if (s[i] == t[je - 1]) {
        ds[j][je] = Sum(ds[j][je], ds[j][je - 1]);
      }
    }
    if (s[i + 1] == t[m - 1]) {
      d0[i + 1] = ds[m - i - 2][m - 1];
    }
  }
  vector<int> d(m + 1, 0);
  d[m] = 1;
  int res = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (s[i] == t[j]) {
        d[j] = Sum(d[j], d[j + 1]);
      }
    }
    d[m] = Sum(d[m], d[m]);
    if (i < m) {
      d[m - i - 1] = Sum(d[m - i - 1], d0[i]);
    }
    res = Sum(res, d[0]);
  }
  cout << res << "\n";
  return 0;
}
