import java.io.*; import java.util.*; class Main { static final long MOD=1000000007; static ArrayList[]g; static int k; static long[][][]dp; static void mul(long[]x,long[]y,int xl,int yl){ long[]r=new long[k+1]; for(int i=0;i<=xl;++i){ for(int j=0;j<=Math.min(k-i,yl);++j){ r[i+j]=(r[i+j]+x[i]*y[j])%MOD; } } System.arraycopy(r,0,x,0,k+1); } static int dfs(int v,int p){ int c=1; dp[0][v][0]=1; dp[1][v][1]=1; long[]tmp=new long[k+1]; for(int w:g[v]){ if(p==w)continue; int sub=dfs(w,v); mul(dp[1][v],dp[1][w],c,sub); for(int j=0;j<=k;++j)tmp[j]=(dp[0][w][j]+dp[1][w][j])%MOD; mul(dp[0][v],tmp,c,sub); c+=sub; } return c; } @SuppressWarnings("unchecked") public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n=sc.nextInt(); k=sc.nextInt(); g=new ArrayList[n]; Arrays.setAll(g,x->new ArrayList()); for(int i=0;i