#abc300h. [abc300_h]Fibonacci: Revisited

[abc300_h]Fibonacci: Revisited

Problem Statement

We define the general term ana_n of a sequence a0,a1,a2,dotsa_0, a_1, a_2, \\dots by:

$a_n = \\begin{cases} 1 & (0 \\leq n \\lt K) \\\\ \\displaystyle{\\sum_{i=1}^K} a_{n-i} & (K \\leq n). \\\\ \\end{cases}$

Given an integer NN, find the sum, modulo 998244353998244353, of ama_m over all non-negative integers mm such that mtextANDN=mm\\text{ AND }N = m. (textAND\\text{AND} denotes the bitwise AND.)

What is bitwise AND? The bitwise AND of non-negative integers AA and BB, AtextANDBA\\text{ AND }B, is defined as follows.
・When AtextANDBA\\text{ AND }B is written in binary, its 2k2^ks place (kgeq0k \\geq 0) is 11 if 2k2^ks places of AA and BB are both 11, and 00 otherwise.

Constraints

  • 1leqKleq5times1041 \\leq K \\leq 5 \\times 10^4
  • 0leqNleq10180 \\leq N \\leq 10^{18}
  • NN and KK are integers.

Input

The input is given from Standard Input in the following format:

KK NN

Output

Print the answer.


Sample Input 1

2 6

Sample Output 1

21

a0a_0 and succeeding terms are 1,1,2,3,5,8,13,21,dots1, 1, 2, 3, 5, 8, 13, 21, \\dots. Four non-negative integers, 0,2,40, 2, 4, and 66, satisfy 6textANDm=m6 \\text{ AND } m = m, so the answer is 1+2+5+13=211 + 2 + 5 + 13 = 21.


Sample Input 2

2 8

Sample Output 2

35

Sample Input 3

1 123456789

Sample Output 3

65536

Sample Input 4

300 20230429

Sample Output 4

125461938

Sample Input 5

42923 999999999558876113

Sample Output 5

300300300