given two integers n and d, find the number of balanced words of length n that can be produced by the word processor. as the answer can be large, return it modulo (10^9 7)