#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 2e18;
template <typename T>
struct rge {
  T b, e;
};
template <typename T>
rge<T> range(T i, T j) {
  return {i, j};
}
struct printer {
  template <typename T>
  printer& operator,(const T& x) {
    cerr << boolalpha << x;
    return *this;
  }
  printer& operator,(const string& x) {
    cerr << x;
    return *this;
  }
  template <typename T, typename C>
  printer& operator,(const pair<T, C>& x) {
    return *this, "(", x.first, ", ", x.second, ")";
  }
  template <typename... C, template <typename...> typename T>
  printer& operator,(const T<C...>& x) {
    return *this, range(begin(x), end(x));
  }
  template <typename T>
  printer& operator,(const rge<T>& x) {
    *this, "{ ";
    for (auto it = x.b; it != x.e; ++it) {
      if (it != x.b) *this, ", ";
      *this, *it;
    }
    return *this, " }";
  }
  ~printer() { cerr << "\n"; }
};
const int N = 3007;
const int MOD = 998244353;
int dp[N][N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size();
  dp[0][n] = 1;
  for (int len = n - 1; len >= 0; --len) {
    for (int i = 0, j = len; j <= n; ++i, ++j) {
      dp[i][j] = (i == 0 and j >= m);
      if (j < n) {
        if ((j < m and s[len] == t[j]) or j >= m) {
          dp[i][j] += dp[i][j + 1];
          if (dp[i][j] >= MOD) dp[i][j] -= MOD;
        }
      }
      if (i > 0) {
        if ((i <= m and s[len] == t[i - 1]) or i > m) {
          dp[i][j] += dp[i - 1][j];
          if (dp[i][j] >= MOD) dp[i][j] -= MOD;
        }
      }
    }
  }
  int res = 0;
  for (int i = 0; i <= n; ++i) {
    res += dp[i][i];
    if (res >= MOD) res -= MOD;
  }
  cout << res << "\n";
  return 0;
}
