{"raw_statement":[{"iden":"problem statement","content":"We define the general term $a_n$ of a sequence $a_0, a_1, a_2, \\dots$ by:\n\n$a_n = \\begin{cases} 1 & (0 \\leq n \\lt K) \\\\ \\displaystyle{\\sum_{i=1}^K} a_{n-i} & (K \\leq n). \\\\ \\end{cases}$\n\n  \n\nGiven an integer $N$, find the sum, modulo $998244353$, of $a_m$ over all non-negative integers $m$ such that $m\\text{ AND }N = m$. ($\\text{AND}$ denotes the bitwise AND.)\nWhat is bitwise AND? The bitwise AND of non-negative integers $A$ and $B$, $A\\text{ AND }B$, is defined as follows.  \n・When $A\\text{ AND }B$ is written in binary, its $2^k$s place ($k \\geq 0$) is $1$ if $2^k$s places of $A$ and $B$ are both $1$, and $0$ otherwise."},{"iden":"constraints","content":"*   $1 \\leq K \\leq 5 \\times 10^4$\n*   $0 \\leq N \\leq 10^{18}$\n*   $N$ and $K$ are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$K$ $N$"},{"iden":"sample input 1","content":"2 6"},{"iden":"sample output 1","content":"21\n\n$a_0$ and succeeding terms are $1, 1, 2, 3, 5, 8, 13, 21, \\dots$. Four non-negative integers, $0, 2, 4$, and $6$, satisfy $6 \\text{ AND } m = m$, so the answer is $1 + 2 + 5 + 13 = 21$."},{"iden":"sample input 2","content":"2 8"},{"iden":"sample output 2","content":"35"},{"iden":"sample input 3","content":"1 123456789"},{"iden":"sample output 3","content":"65536"},{"iden":"sample input 4","content":"300 20230429"},{"iden":"sample output 4","content":"125461938"},{"iden":"sample input 5","content":"42923 999999999558876113"},{"iden":"sample output 5","content":"300300300"}],"translated_statement":null,"sample_group":[],"show_order":["render_html"],"formal_statement":null,"simple_statement":null,"has_page_source":true}