5. Dividing forest There is a rectangular forest with a total of \( m \) * \( n \) trees planted, with a total of 3 species of trees, number 1 means pine tree, 2 means poplar tree and 3 means willow tree. Now the forest needs to be divided into \( x \) parts for \( x \) people to take care of. The forest can be divided horizontally or vertically, and each division needs to divide the whole forest into two parts. If the division is horizontal, give the top one to one person and continue to divide the forest below; if the division is vertical, give the left one to one person and continue to divide the forest on the right. You need to make sure that each person has at least one poplar tree. Please calculate how many divisions there are in total. Since the answer may be a very large number, please return the result of taking the remainder of \( 10 \mathrm{e} 9+7 \). Example: Input forest \( =[[1,2,3] \), \( [2,1,2],[3,1,1]] \), number \( =3 \). Output: 4 the remainder of \( 10 \mathrm{e} 9+7 \).