#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
string s, t;
long long dp[3009][3009];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> s >> t;
  for (long long j = 0; j <= t.size(); ++j) dp[0][j] = 1;
  for (long long i = 0; i < s.size(); ++i) {
    for (long long j = 0; j <= t.size(); ++j) {
      if (j + i >= t.size())
        dp[i + 1][j] = (dp[i][j] + dp[i + 1][j]) % mod;
      else if (t[j + i] == s[i])
        dp[i + 1][j] = (dp[i][j] + dp[i + 1][j]) % mod;
      if (j != 0 && s[i] == t[j - 1]) {
        dp[i + 1][j - 1] = (dp[i][j] + dp[i + 1][j - 1]) % mod;
      }
      if (i == 0 && j != t.size() && s[i] == t[j]) {
        --dp[i + 1][j];
        if (dp[i + 1][j] < 0) dp[i + 1][j] += mod;
      }
      if (j == t.size() && i != 0) {
        dp[i + 1][j] = (dp[i][j] + dp[i + 1][j]) % mod;
      }
    }
  }
  long long ans = 0;
  for (long long i = t.size(); i <= s.size(); ++i)
    ans = (ans + 2 * dp[i][0] % mod) % mod;
  cout << ans << '\n';
}
