#arc141b. [arc141_b]Increasing Prefix XOR

[arc141_b]Increasing Prefix XOR

Problem Statement

You are given positive integers NN and MM.

Find the number of sequences A=(A1,A2,dots,AN)A=(A_1,\\ A_2,\\ \\dots,\\ A_N) of NN positive integers that satisfy the following conditions, modulo 998244353998244353.

  • 1leqA1<A2<dots<ANleqM1 \\leq A_1 < A_2 < \\dots < A_N \\leq M.
  • B1<B2<dots<BNB_1 < B_2 < \\dots < B_N, where Bi=A1oplusA2oplusdotsoplusAiB_i = A_1 \\oplus A_2 \\oplus \\dots \\oplus A_i.

Here, oplus\\oplus denotes bitwise mathrmXOR\\mathrm{XOR}.

What is bitwise mathrmXOR\\mathrm{XOR}?

The bitwise mathrmXOR\\mathrm{XOR} of non-negative integers AA and BB, AoplusBA \\oplus B, is defined as follows:

  • When AoplusBA \\oplus B is written in base two, the digit in the 2k2^k's place (kgeq0k \\geq 0) is 11 if exactly one of AA and BB is 11, and 00 otherwise.

For example, we have 3oplus5=63 \\oplus 5 = 6 (in base two: 011oplus101=110011 \\oplus 101 = 110).
Generally, the bitwise mathrmXOR\\mathrm{XOR} of kk non-negative integers p1,p2,p3,dots,pkp_1, p_2, p_3, \\dots, p_k is defined as $(\\dots ((p_1 \\oplus p_2) \\oplus p_3) \\oplus \\dots \\oplus p_k)$. We can prove that this value does not depend on the order of p1,p2,p3,dots,pkp_1, p_2, p_3, \\dots, p_k.

Constraints

  • 1leqNleqM<2601 \\leq N \\leq M < 2^{60}
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM

Output

Print the answer.


Sample Input 1

2 4

Sample Output 1

5

For example, (A1,A2)=(1,3)(A_1,\\ A_2)=(1,\\ 3) counts, since A1<A2A_1 < A_2 and B1<B2B_1 < B_2 where B1=A1=1,B2=A1oplusA2=2B_1=A_1=1,\\ B_2=A_1\\oplus A_2=2.

The other pairs that count are $(A_1,\\ A_2)=(1,\\ 2),\\ (1,\\ 4),\\ (2,\\ 4),\\ (3,\\ 4)$.


Sample Input 2

4 4

Sample Output 2

0

Sample Input 3

10 123456789

Sample Output 3

205695670