#P8442. Circular Ball Passing
Circular Ball Passing
Circular Ball Passing
There are n students standing in a circle. Initially, one student (LGD) holds a ball. In each move, the student who currently holds the ball may pass it to one of his two adjacent students (either left or right). Your task is to count the number of distinct passing sequences such that after exactly m passes the ball returns to LGD. Two passing sequences are considered different if the sequence of ball receivers (in the order they receive the ball) is different.
Output the answer modulo \(720000054000001\).
inputFormat
The input consists of a single line containing two integers n and m, where n is the number of students and m is the number of passes.
outputFormat
Output a single integer – the number of valid passing sequences modulo \(720000054000001\).
sample
3 1
0