#![allow(unused_imports)] #![allow(non_snake_case)] use std::cmp::*; use std::collections::*; use std::io::Write; #[allow(unused_macros)] macro_rules! debug { ($($e:expr),*) => { #[cfg(debug_assertions)] $({ let (e, mut err) = (stringify!($e), std::io::stderr()); writeln!(err, "{} = {:?}", e, $e).unwrap() })* }; } fn main() { let v = read_vec::(); let (n, m) = (v[0], v[1] as usize); if n > m as i64 || n == 1 { println!("1"); return; } let n = n as usize; let mut dp = vec![0; m + 1]; dp[0] = 1; for i in 1..m + 1 { dp[i] += dp[i - 1]; if i >= n { dp[i] += dp[i - n]; } dp[i] %= 998244353; } println!("{}", dp[m]); } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { read::() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() }