#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = (int)5e5 + 100;
const int M = (int)2e6 + 100;
const int inf = (int)1e9 + 100;
string s, t;
long long mod = 998244353;
bool was[3001][3001];
long long table[3001][3001];
long long f(int x, int y) {
  if (x < 0) return 1;
  if (was[x][y]) return table[x][y];
  was[x][y] = 1;
  long long o = 0;
  if (y == t.length()) {
    o += 2 * f(x - 1, y) % mod;
    o %= mod;
    return table[x][y] = o;
  }
  if (s[x] == t[y]) {
    o += f(x - 1, y + 1);
    o %= mod;
  }
  if (x + 1 + y <= t.length()) {
    if (s[x] == t[y + x]) {
      o += f(x - 1, y);
      o %= mod;
    }
  } else {
    o += f(x - 1, y);
    o %= mod;
  }
  return table[x][y] = o;
}
int main() {
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  srand(time(0));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s >> t;
  long long ans = 0;
  int i;
  for ((i) = (t.length() - 1); (i) < (s.length()); (i)++) {
    ans += f(i, 0);
    ans %= mod;
  }
  cout << ans;
}
