Georgie is experimenting with a scheme for generating a pseudo-random integer in the range 0 to m−1.
He first fixes n and generates n integers a1,a2,…,an, each in the range 0 to m−1. He then repeatedly replaces the current array with the array of sums of adjacent elements: from a1,a2,…,an he forms a1+a2,a2+a3,…,an−1+an (which has n−1 elements), and applies the same step again and again until a single number remains. That last number, taken modulo m, is the output of the scheme.
A weakness of this scheme is that the final result sometimes does not depend on some of the originally generated numbers. For example, when n=3 and m=2 the result never depends on a2.
Call the i-th original element irrelevant if the final result never depends on ai, no matter how the other numbers are chosen. Given n and m, determine which elements are irrelevant.
A single line with two integers n and m (1≤n≤100000, 2≤m≤109).
On the first line, print the number of irrelevant elements. On the second line, print in ascending order, separated by single spaces, the indices i of all irrelevant elements. If there are no irrelevant elements, print an empty second line.