#include <bits/stdc++.h>
using namespace std;
int n, m;
string s, ss;
long long mod = 998244353;
long long mem[3005][3005];
long long dp(int idx1, int idx2) {
  if (idx1 == 0) {
    if (idx2 >= m) {
      long long rem = n - (idx2 - idx1) + 1;
      return rem;
    }
  }
  if (mem[idx1][idx2] != -1) return mem[idx1][idx2];
  long long ret = 0;
  int idx = idx2 - idx1;
  if (idx1 > 0) {
    if (idx1 >= m || s[idx] == ss[idx1]) {
      ret += dp(idx1 - 1, idx2);
      ret %= mod;
    }
  }
  if (idx2 < n) {
    if (idx2 >= m || s[idx] == ss[idx2]) {
      ret += dp(idx1, idx2 + 1);
      ret %= mod;
    }
  }
  return mem[idx1][idx2] = ret;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> s >> ss;
  s = "." + s;
  ss = "." + ss;
  n = s.length();
  m = ss.length();
  memset(mem, -1, sizeof mem);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long x = dp(i, i + 1);
    ans += x;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
