Floorfiller
题号:NC17707
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Niuniu wants to fill an n x m sheet with 0s and 1s.

Niuniu wants the xor sum for each row and each column is 0.

In other words there is a even number of 1 in each row and each column.

Two sheets are considered the same, if they are identical after cyclic shift (vertical or horizontal).

Formally, for two sheets A and B, if we can find x and y such that

we will consider A and B are the same sheet.

Niuniu  wants to know the number of ways to fill the sheet.

As the result might be very large, he wants to know the result modulo 998244353. 

输入描述:

The first line contains two integers, which are n and m.

1 <= n <= 109
1 <= m <= 109

输出描述:

You should output one integer, which is the answer modulo 998244353.
示例1

输入

复制
4 4

输出

复制
48
示例2

输入

复制
4 6

输出

复制
1448
示例3

输入

复制
998244353 998244353

输出

复制
295980207