import Debug.Trace

import Data.List (mapAccumL)

main :: IO ()
main = do
    [n, m] <- fmap read . words <$> getLine
    answer $ solve n m

type Answer = Int
answer :: Answer -> IO ()
answer = print

theMod = 998244353

solve :: Int -> Int -> Answer
solve n m = inner 1 1 1 (replicate (n - 1) 1)
  where
    inner k c d is
      | k >= m    = last is
      | otherwise = inner (succ k) d d' is'
      where
        is' = snd $ mapAccumL ((.) ((,) <*> id) . (+/)) d' is
        d'
          | k == 1    = 1
          | otherwise = c + d

x +/ y = until (theMod >) (`mod` theMod) $ x + y
