#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
char s[3001], t[3001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> (s + 1) >> (t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  vector<vector<int>> dp(n + 1, vector<int>(n + 1, 0));
  for (int i = m; i <= n; ++i) {
    if (i > m || s[i] == t[m]) dp[i][0] = 1;
    if (s[i] == t[1]) dp[i][1] = 1;
  }
  for (int i = n; i > 1; --i) {
    for (int j = 0; j <= n - i + 1; ++j) {
      if (j + 1 > m || s[i - 1] == t[j + 1])
        dp[i - 1][j + 1] = (dp[i - 1][j + 1] + dp[i][j]) % mod;
      if (i > 1) {
        int first = j + i - 1;
        if (first > m || s[i - 1] == t[first]) {
          dp[i - 1][j] = (dp[i - 1][j] + dp[i][j]) % mod;
        }
      }
    }
  }
  int rez = 0;
  for (int j = 0; j <= n; ++j) rez = (rez + dp[1][j]) % mod;
  return cout << rez, 0;
}
