#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int dp[3001][3001];
int add(int x, int y) {
  x += y;
  while (x >= MOD) {
    x -= MOD;
  }
  while (x < 0) {
    x += MOD;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s1, s2;
  cin >> s1 >> s2;
  int n = s1.size();
  int m = s2.size();
  dp[n][0] = 1;
  for (int i = n - 1; i >= 1; i--) {
    for (int j = 0; j <= m; j++) {
      if (j == 0) {
        if (i >= m) {
          dp[i][j] = add(dp[i][j], n - i + 1);
        } else if (s1[i] == s2[i]) {
          dp[i][j] = add(dp[i][j], dp[i + 1][j]);
        }
      } else if (j > 0 && j < m) {
        if (i + j >= m || s1[i] == s2[i + j]) {
          dp[i][j] = add(dp[i][j], dp[i + 1][j]);
        }
        if (s1[i] == s2[j - 1]) {
          dp[i][j] = add(dp[i][j], dp[i + 1][j - 1]);
        }
      } else if (j == m) {
        dp[i][j] = add(dp[i][j], dp[i + 1][j]);
        dp[i][j] = add(dp[i][j], dp[i + 1][j]);
        if (s1[i] == s2[m - 1]) {
          dp[i][j] = add(dp[i][j], dp[i + 1][j - 1]);
        }
      }
    }
  }
  int sol = dp[1][m];
  for (int i = 0; i < m; i++) {
    if (s1[0] == s2[i]) {
      sol = add(sol, dp[1][i]);
    }
  }
  sol = add(sol, sol);
  cout << sol << endl;
}
