#R1022. [KBC002F] Calculate 1
[KBC002F] Calculate 1
Problem Description
A new bitwise operation is defined as follows: , , , .
Output the number of strings of length (modulo ) that satisfy the following conditions:
- $((((A_1\sharp A_2)\sharp A_3)\sharp\cdots)\sharp A_{N-1})\sharp A_N=1$;
- $A_1\sharp(A_2\sharp(A_3\sharp(\cdots\sharp(A_{N-1}\sharp A_N))))=1$.
Constraints
- .
Input
An integer .
Output
The result modulo .
Sample Input 1
20
Sample Output 1
699051