import java.io.*; import java.util.*; public class Main { static int[][] dp; static int[] children; static final int MOD = 1000000007; static ArrayList> graph = new ArrayList<>(); public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int k = sc.nextInt(); for (int i = 0; i < n; i++) { graph.add(new ArrayList<>()); } for (int i = 0; i < n - 1; i++) { int a = sc.nextInt(); int b = sc.nextInt(); graph.get(a).add(b); graph.get(b).add(a); } dp = new int[n][n + 1]; children = new int[n]; getChildren(0, 0); System.out.println(dp[0][k]); } static int getChildren(int idx, int parent) { int count = 1; dp[idx][0] = 1; for (int x : graph.get(idx)) { if (x == parent) { continue; } int tmp = getChildren(x, idx); for (int i = count - 1; i >= 0; i--) { for (int j = 1; j <= children[x]; j++) { dp[idx][i + j] += (int)((long)dp[idx][i] * dp[x][j] % MOD); dp[idx][i + j] %= MOD; } } count += tmp; } dp[idx][count] = 1; return children[idx] = count; } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }