#arc146c. [arc146_c]Even XOR
[arc146_c]Even XOR
Problem Statement
How many sets consisting of non-negative integers between and (inclusive) satisfy the following condition? Print the count modulo .
- Every non-empty subset of satisfies at least one of the following:
- The number of elements in is odd.
- The of the elements in is not zero.
What is ?
The bitwise of non-negative integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if exactly one of the digits in that place of and is , and otherwise.
For example, we have (in base two: ).
Generally, the bitwise of non-negative integers 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 .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2
Sample Output 1
15
Sets such as , , and satisfy the condition.
On the other hand, does not.
This is because the subset of has an even number of elements, whose bitwise is .
Sample Input 2
146
Sample Output 2
743874490