#include <bits/stdc++.h>
constexpr long long mod = 998244353;
std::string s, t;
long long data[3005], data2[3005];
signed main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  std::cin >> s >> t;
  int n = s.size();
  int m = t.size();
  for (int i = 0; i < m; i++) {
    data[i] = (s[0] == t[i]) * 2;
  }
  long long res(0);
  data[m] = 2;
  for (char c : s.substr(1)) {
    std::fill(data2, data2 + n + 1, 0);
    for (int i = 0; i < m; i++) {
      data2[i] += data[i + 1] * (c == t[i]);
      data2[i] -= mod * (data2[i] >= mod);
    }
    static int k = 0;
    for (int i = ++k; i < m; i++) {
      data2[i - k] += data[i - k] * (c == t[i]);
      data2[i - k] -= mod * (data2[i - k] >= mod);
    }
    res += data[0] * (k >= (m));
    for (int i = 0; i < std::min(k, m); i++) {
      data2[m - i - 1] += data[m - i - 1];
      data2[m - i - 1] -= mod * (data2[m - i - 1] >= mod);
    }
    data2[m] += data[m] * 2;
    data2[m] %= mod;
    std::swap(data, data2);
  }
  std::cout << ((data[0] + res) % mod);
  return 0;
}
