#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}
const int MAXN = 3003;
string t, s;
int n, m;
LL dp[MAXN][MAXN];
LL mod = 998244353;
bool vis[MAXN][MAXN];
LL dfs(int i, int j) {
  (i, j);
  if (j == i - 1) {
    return 1;
  }
  if (vis[i][j]) {
    return dp[i][j];
  }
  vis[i][j] = true;
  char last = s[(j - i) + 1];
  LL actRes = 0;
  if (i > m || last == t[i]) {
    actRes += dfs(i + 1, j);
    actRes %= mod;
  }
  if (j > m || last == t[j]) {
    actRes += dfs(i, j - 1);
    actRes %= mod;
  }
  dp[i][j] = actRes;
  return dp[i][j];
}
int main() {
  cin >> s >> t;
  n = s.size();
  m = t.size();
  s = "#" + s;
  t = "#" + t;
  LL res = dfs(1, n);
  res = 0;
  for (int i = m; i <= n; ++i) {
    res += dp[1][i];
    res %= mod;
  }
  cout << res << endl;
}
