#include <bits/stdc++.h>
using namespace std;
long int gcd(long int i, long int j) {
  while (i > 0 && j > 0) {
    i = i % j;
    if (i > 0) {
      j = j % i;
    }
  }
  return i + j;
}
int main() {
  unsigned int mod = 998244353;
  string s, t;
  cin >> s >> t;
  int n, m;
  unsigned int res = 0;
  n = s.size();
  m = t.size();
  vector<vector<unsigned int> > poss(n, vector<unsigned int>(n, 0));
  for (int i = 0; i < m; i += 1) {
    if (s[0] == t[i]) {
      poss[i][i] = 2;
    }
  }
  for (int i = m; i < n; i += 1) {
    poss[i][i] = 2;
  }
  for (int i = 1; i < n; i += 1) {
    for (int j = 0; j < m; j += 1) {
      if (s[i] == t[j]) {
        if (j - i >= 0) {
          poss[j - i][j] += poss[j - i][j - 1];
          poss[j - i][j] %= mod;
        }
        if (i + j < n) {
          poss[j][i + j] += poss[j + 1][i + j];
          poss[j][i + j] %= mod;
        }
      }
    }
    for (int j = m; j < n; j += 1) {
      if (j - i >= 0) {
        poss[j - i][j] += poss[j - i][j - 1];
        poss[j - i][j] %= mod;
      }
      if (j + i < n) {
        poss[j][j + i] += poss[j + 1][j + i];
        poss[j][j + i] %= mod;
      }
    }
  }
  for (int i = m - 1; i < n; i += 1) {
    res += poss[0][i];
    res %= mod;
  }
  cout << res << endl;
  return 0;
}
