#arc139f. [arc139_f]Many Xor Optimization Problems

[arc139_f]Many Xor Optimization Problems

Problem Statement

PCT made the following problem.

Xor Optimization Problem

You are given a sequence of non-negative integers of length NN: A1,A2,...,ANA_1,A_2,...,A_N. When it is allowed to choose any number of elements in AA, what is the maximum possible mathrmXOR\\mathrm{XOR} of the chosen values?

Nyaan thought it was too easy and revised it to the following.

Many Xor Optimization Problems

There are 2NM2^{NM} sequences of length NN consisting of integers between 00 and 2M12^M-1. Find the sum, modulo 998244353998244353, of the answers to Xor Optimization Problem for all those sequences.

Solve Many Xor Optimization Problems.

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

  • 1leN,Mle2500001 \\le N,M \\le 250000
  • 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 1

Sample Output 1

3

We are to solve Xor Optimization Problem for all sequences of length 22 consisting of integers between 00 and 11.

  • The answer for A=(0,0)A=(0,0) is 00.
  • The answer for A=(0,1)A=(0,1) is 11.
  • The answer for A=(1,0)A=(1,0) is 11.
  • The answer for A=(1,1)A=(1,1) is 11.

Thus, the final answer is 0+1+1+1=30+1+1+1=3.


Sample Input 2

3 4

Sample Output 2

52290

Sample Input 3

1234 5678

Sample Output 3

495502261