#Lutece3226. 树上序列

树上序列

Migrated from Lutece 3226 树上序列

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给定一棵 nn 个点且以 11 为根的有根树,及常数 VV

求序列 {an}\{a_n\} 的个数,满足

  1. i[1,n],ai[1,V]\forall i\in[1,n], a_i\in[1,V]
  2. i[2,n],aiafai\forall i\in[2,n],a_i\leq a_{fa_i}

其中 faifa_i 表示节点 ii 的父节点。答案对 109+710^9+7 取模。

Input

第一行,两个正整数 nnVV

接下来 n1n-1 行,每行两个正整数,描述一条边 uvu\leftrightarrow v

Output

一行,一个整数,表示答案。

Samples

4 3
2 1
3 1
4 1
36

Constraints

1n5×1031\leq n\leq 5\times 10^31V1091\leq V\leq 10^9

Resources

2024 UESTC ICPC Training for Math