#include <bits/stdc++.h>
using namespace std;
template <class L, class R>
ostream& operator<<(ostream& cout, pair<L, R> P) {
  return cout << '(' << P.first << ',' << P.second << ')';
}
template <class T>
ostream& operator<<(ostream& cout, vector<T> V) {
  cout << "[ ";
  for (auto v : V) cout << v << ' ';
  return cout << ']';
}
inline long long ex(long long a, long long b) {
  if (b == 0 || a == 1) {
    return 1;
  }
  if (a == 0 || b == 1) {
    return a;
  }
  long long tmp = ex(a, (b / 2));
  if (b % 2) {
    return ((((tmp * tmp) % 998244353) * a) % 998244353);
  } else {
    return ((tmp * tmp) % 998244353);
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s, t;
  cin >> s >> t;
  long long n = s.length();
  long long m = t.length();
  vector<vector<long long>> g(n + 1, vector<long long>(m + 1, 0));
  for (long long i = 0; i < m; ++i) {
    g[0][i] = 1;
  }
  for (long long i = 0; i < m; ++i) {
    g[1][i] = (s[0] == t[i]) * 2;
    g[1][i] %= 998244353;
  }
  for (long long len = 2; len <= n; ++len) {
    for (long long ept = 0; ept < m; ++ept) {
      if (ept - 1 >= 0) {
        g[len][ept] += (g[len - 1][ept - 1] * (s[len - 1] == t[ept]));
        g[len][ept] %= 998244353;
      }
      if ((ept - len + 1) >= 0) {
        g[len][ept] += (g[len - 1][ept] * (s[len - 1] == t[ept - len + 1]));
        g[len][ept] %= 998244353;
      }
    }
  }
  vector<vector<long long>> f(n + 1, vector<long long>(m + 1, 0));
  for (long long i = 0; i <= n; ++i) {
    f[i][0] = ex(2, i);
  }
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= m; ++j) {
      f[i][j] = f[i - 1][j];
      if (s[i - 1] == t[m - j]) {
        f[i][j] += f[i - 1][j - 1];
        f[i][j] %= 998244353;
      }
      if (i == j and s[i - 1] == t[m - 1]) {
        if ((i - 1) == 0) {
          f[i][j] += 1;
        } else {
          if (m != 1) {
            f[i][j] += (g[i - 1][m - 2]);
            f[i][j] %= 998244353;
          }
        }
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i <= n; ++i) {
    ans += f[i][m];
    ans %= 998244353;
  }
  cout << ans << "\n";
}
