#include <stdio.h>

long long power_mod (long long a, long long b, long long mod_num) {
  long long ans = 1LL;
  
  if (b > 0LL) {
    ans = power_mod(a, b/2LL, mod_num);
    ans = (ans * ans) % mod_num;
    if (b%2LL == 1LL) {
      ans = (ans * a) % mod_num;
    }
  }
  
  return ans;
}

int main () {
  int n = 0;
  int m = 0;
  
  int res = 0;
  
  long long ans = 0LL;
  long long mod_num = 998244353LL;
  
  long long fact[1000001] = {};
  long long invf[1000001] = {};
  
  int d = 0;
  int r = 0;
  
  res = scanf("%d", &n);
  res = scanf("%d", &m);
  
  fact[0] = 1LL;
  for (int i = 0; i < m; i++) {
    fact[i+1] = fact[i];
    fact[i+1] *= (long long) (i+1);
    fact[i+1] %= mod_num;
  }
  
  invf[m] = power_mod(fact[m], mod_num-2LL, mod_num);
  
  for (int i = m; i > 0; i--) {
    invf[i-1] = invf[i];
    invf[i-1] *= (long long)i;
    invf[i-1] %= mod_num;
  }
  
  d = m/n;
  r = m%n;
  
  ans = fact[m];
  for (int i = 0; i < r; i++) {
    ans *= invf[d+1];
    ans %= mod_num;
  }
  for (int i = 0; i < n-r; i++) {
    ans *= invf[d];
    ans %= mod_num;
  }
  
  printf("%lld\n", ans);
  return 0;
}