#abc278h. [abc278_h]make 1
[abc278_h]make 1
Problem Statement
A sequence of non-negative integers is said to be a good sequence if:
- there exists a non-empty (not necessarily contiguous) subsequence of such that the bitwise XOR of all elements in is .
There are an empty sequence , and cards with each of the integers between and written on them.
You repeat the following operation until becomes a good sequence:
- You freely choose a card and append the integer written on it to the tail of . Then, you eat the card. (Once eaten, the card cannot be chosen anymore.)
How many sequences of length can be the final after the operations? Find the count modulo .
What is bitwise XOR? The bitwise of non-negative integers and , , is defined as follows.
- When is written in binary, the -th lowest bit () is if exactly one of the -th lowest bits of and is , and otherwise.
For instance, (in binary: ).
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 2
Sample Output 1
5
The following five sequences of length can be the final after the operations.
Sample Input 2
2022 1119
Sample Output 2
293184537
Sample Input 3
200000 10000000
Sample Output 3
383948354