#include <bits/stdc++.h>
using namespace std;
string s, t;
const long long mod = 998244353;
long long d[3000 + 5][3000 + 5];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s >> t;
  int n = (int)(s).size(), m = (int)(t).size();
  s = " " + s;
  t = " " + t;
  int i, j, z;
  vector<pair<int, int> > seg;
  for (i = 1; i <= n; i++)
    for (j = i; j <= n; j++) seg.push_back(pair<int, int>(i, j));
  sort(begin(seg), end(seg), [](pair<int, int> a, pair<int, int> b) {
    return a.second - a.first < b.second - b.first;
  });
  for (pair<int, int> cur : seg) {
    i = cur.first;
    j = cur.second;
    if (i == j) {
      if (i <= m) {
        if (s[1] == t[i])
          d[i][j] = 1;
        else
          d[i][j] = 0;
      } else
        d[i][j] = 1;
    } else {
      if (i > m || s[j - i + 1] == t[i])
        d[i][j] = (d[i][j] + d[i + 1][j]) % mod;
      if (j > m || s[j - i + 1] == t[j])
        d[i][j] = (d[i][j] + d[i][j - 1]) % mod;
    }
  }
  long long ans = 0;
  for (i = m; i <= n; i++) ans = (ans + d[1][i]) % mod;
  cout << (ans * 2) % mod;
  return 0;
}
