Some rumors about Zhang3 have been spread on the Internet. Zhang3 needs to dispel the rumors, but she's busy preparing her birthday party, so she asks her m classmates for help. Her classmates decide to have a meeting for discussion.
The m classmates live in the same community. There are n houses in the community, labeled 1,2,…,n. There are (n−1) roads connecting the houses, the ith of which connects house (i+1) and fi+1, forming a tree. Each road is 1 km long.
The m classmates live in m different houses. They always choose such a house to have the meeting, that the total distance to travel for the m classmates is minimized. The optimal total distance (in km) to travel is called the cost of the meeting.
Zhang3 doesn't know which houses her classmates live in, so there are (nm) different cases of that. Zhang3 wants to know the sum of the cost in all cases. As the answer can be very large, please help her calculate the answer modulo 109+7.