#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
using namespace std;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
template <class T, class U>
inline void checkmin(T &x, U y) {
  if (y < x) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
  if (y > x) x = y;
}
template <class T, class U>
inline bool ifmax(T &x, U y) {
  if (y > x) return x = y, true;
  return false;
}
template <class T, class U>
inline bool ifmin(T &x, U y) {
  if (y < x) return x = y, true;
  return false;
}
template <class T>
inline void sort(T &a) {
  sort(a.begin(), a.end());
}
template <class T>
inline void rsort(T &a) {
  sort(a.rbegin(), a.rend());
}
template <class T>
inline void reverse(T &a) {
  reverse(a.begin(), a.end());
}
template <class T, class U>
inline istream &operator>>(istream &str, pair<T, U> &p) {
  return str >> p.first >> p.second;
}
template <class T>
inline istream &operator>>(istream &str, vector<T> &a) {
  for (auto &i : a) str >> i;
  return str;
}
template <class T>
inline T sorted(T a) {
  sort(a);
  return a;
}
struct zet {
  int val;
  explicit operator int() const { return val; }
  zet(long long x = 0) {
    val = (x >= -998244353 && x < 998244353 ? x : x % 998244353);
    if (val < 0) val += 998244353;
  }
  zet(long long a, long long b) {
    *this += a;
    *this /= b;
  }
  zet &operator+=(zet const &b) {
    val += b.val;
    if (val >= 998244353) val -= 998244353;
    return *this;
  }
  zet &operator-=(zet const &b) {
    val -= b.val;
    if (val < 0) val += 998244353;
    return *this;
  }
  zet &operator*=(zet const &b) {
    val = (val * (long long)b.val) % 998244353;
    return *this;
  }
  friend zet mypow(zet a, long long n) {
    zet res = 1;
    while (n) {
      if (n & 1) res *= a;
      a *= a;
      n >>= 1;
    }
    return res;
  }
  friend zet inv(zet a) { return mypow(a, 998244353 - 2); }
  zet &operator/=(zet const &b) { return *this *= inv(b); }
  friend zet operator+(zet a, const zet &b) { return a += b; }
  friend zet operator-(zet a, const zet &b) { return a -= b; }
  friend zet operator-(zet a) { return 0 - a; }
  friend zet operator*(zet a, const zet &b) { return a *= b; }
  friend zet operator/(zet a, const zet &b) { return a /= b; }
  friend istream &operator>>(istream &stream, zet &a) {
    return stream >> a.val;
  }
  friend ostream &operator<<(ostream &stream, const zet &a) {
    return stream << a.val;
  }
  friend bool operator==(zet const &a, zet const &b) { return a.val == b.val; }
  friend bool operator!=(zet const &a, zet const &b) { return a.val != b.val; }
  friend bool operator<(zet const &a, zet const &b) { return a.val < b.val; }
};
vector<vector<zet>> dp;
inline zet get(int l, int r) {
  if (l > r) return 1;
  return dp[l][r];
}
bool eq(char second, char t) { return t == '#' || second == t; }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(12);
  string second, t;
  cin >> second >> t;
  int st = signed(t.size()), ss = signed(second.size());
  t += string(signed(second.size()) - signed(t.size()), '#');
  second = second + '#';
  t = t + '#';
  assert(signed(second.size()) == signed(t.size()));
  int n = signed(second.size());
  dp = vector<vector<zet>>(n, vector<zet>(n));
  for (int len = 1; len <= n; ++len) {
    for (int i = 0; i + len <= n; ++i) {
      int j = i + len - 1;
      char lst = second[len - 1];
      if (eq(lst, t[i])) dp[i][j] += get(i + 1, j);
      if (eq(lst, t[j])) dp[i][j] += get(i, j - 1);
    }
  }
  zet ans = 0;
  for (int i = st; i <= ss; ++i) ans += get(0, i - 1);
  cout << ans;
  return 0;
}
