#include <bits/stdc++.h>
using namespace std;
long long md = 998244353;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int test = 1;
  while (test--) {
    string s;
    cin >> s;
    string t;
    cin >> t;
    int i = 0;
    long long ans[1 + t.length()];
    int l = t.length();
    while (i <= l) ans[i] = 1, i++;
    int ln = 0;
    long long tt = 0;
    long long p = 1;
    for (char ch : s) {
      i = 0;
      while (i < l) {
        if (i + ln >= l) {
          if (i > 0 && t[i - 1] == ch) {
            ans[i - 1] += ans[i];
            ans[i - 1] %= md;
          }
        } else {
          if (i > 0 && t[i - 1] == ch) {
            ans[i - 1] += ans[i];
            ans[i - 1] %= md;
          }
          if (t[i + ln] != ch) {
            ans[i] = 0;
          }
        }
        i++;
      }
      if (ch == t[l - 1]) ans[l - 1] += p, ans[l - 1] %= md;
      p *= 2;
      p %= md;
      ln++;
      if (ln >= l) tt += ans[0], tt %= md;
    }
    cout << tt << endl;
  }
  return 0;
}
