#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const int nax = 3005;
int dp[2 * nax][2 * nax];
const int MOD = 998244353;
void add_self(int& a, int b) {
  a += b;
  if (a >= MOD) {
    a -= MOD;
  }
}
int main() {
  string s, target;
  cin >> s;
  cin >> target;
  int n = s.length();
  int m = target.length();
  for (int i = 0; i < m; ++i) {
    if (target[i] == s[0]) {
      dp[i][i] = 2;
    }
  }
  for (int i = m; i <= n + m; ++i) {
    dp[i][i] = 2;
  }
  for (int i = 1; i < n; ++i) {
    char ch = s[i];
    for (int L = 0; true; L++) {
      int R = L + i - 1;
      if (R >= n + m) {
        break;
      }
      if (L > 0 && (L - 1 >= m || ch == target[L - 1])) {
        add_self(dp[L - 1][R], dp[L][R]);
      }
      if (R + 1 >= m || ch == target[R + 1]) {
        add_self(dp[L][R + 1], dp[L][R]);
      }
    }
  }
  int answer = 0;
  for (int R = m - 1; R <= n + m; ++R) {
    add_self(answer, dp[0][R]);
  }
  printf("%d\n", answer);
}
