#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAX(int &a, int b) { return a = max(a, b); }
const int MIN(int &a, int b) { return a = min(a, b); }
int n, m;
string second, t;
int dp[3005][3005];
void read() {
  cin >> second >> t;
  n = second.length();
  m = t.length();
}
void solve() {
  dp[n][0] = 1;
  for (int i = n - 1; i >= 1; i--) {
    for (int j = 0; j < m + 1; j++) {
      if (j == 0) {
        if (i >= m) {
          dp[i][j] = n - i + 1;
        } else if (second[i] == t[i]) {
          dp[i][j] = dp[i + 1][j];
        }
      } else if (j == m) {
        dp[i][j] = 2 * dp[i + 1][j] % 998244353;
        if (second[i] == t[j - 1]) {
          dp[i][j] = (dp[i][j] + dp[i + 1][j - 1]) % 998244353;
        }
      } else {
        if (i + j >= m || second[i] == t[i + j]) {
          dp[i][j] = dp[i + 1][j];
        }
        if (second[i] == t[j - 1]) {
          dp[i][j] = (dp[i][j] + dp[i + 1][j - 1]) % 998244353;
        }
      }
    }
  }
  int ans = dp[1][m];
  for (int i = 0; i < m; i++) {
    if (t[i] == second[0]) ans = (ans + dp[1][i]) % 998244353;
  }
  ans = ans * 2 % 998244353;
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    read();
    solve();
  }
}
