Bobo considers balls arranged in a circle. The balls are numbered with 0,1,…, where the ball i and the ball (i+1)mod(n+m) bmod (i+1)mod(n+m) are adjacent. Bobo would like to color n of his balls black and m of his balls white. Bobo groups adjacent balls with same colors, and he determines the weight of the coloring as the product of the lengths of groups. He would like to know the sum of the weight of the possible colorings, modulo .
Bobo considers (n + m) balls arranged in a circle. The balls are numbered with 0,1,…,(n+m−1)0, 1, dots, (n + m - 1)0,1,…,(n+m−1) where the ball i and the ball (i+1) mod (n+m)(i + 1) bmod (n + m)(i+1)mod(n+m) are adjacent. Bobo would like to color n of his balls black and m of his balls white. Bobo groups adjacent balls with same colors, and he determines the weight of the coloring as the product of the lengths of groups. He would like to know the sum of the weight of the possible colorings, modulo (109+7)(10^9+7)(109+7).