#include <bits/stdc++.h>
using namespace std;
const int maxn = 3010;
long long f[maxn][maxn];
const long long mod = 998244353;
int main() {
  string s, t;
  cin >> s >> t;
  int lens = s.length(), lent = t.length();
  for (int i = 0; i < lens; i++) {
    if (i < lent) {
      if (s[0] == t[i]) f[i][i] = 2;
    } else
      f[i][i] = 2;
  }
  for (int len = 1; len < lens; len++) {
    for (int l = 0; l + len < lens; l++) {
      int r = l + len;
      if (l >= lent || s[len] == t[l]) f[l][r] = (f[l][r] + f[l + 1][r]) % mod;
      if (r >= lent || s[len] == t[r]) f[l][r] = (f[l][r] + f[l][r - 1]) % mod;
    }
  }
  long long ans = 0;
  for (int i = lent - 1; i < lens; i++) {
    ans = (ans + f[0][i]) % mod;
  }
  cout << ans << endl;
}
