import java.io.*; import java.util.*; public class Main { static ArrayList> dp = new ArrayList<>(); 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++) { dp.add(new TreeMap<>()); dp.get(i).put(0, 1L); 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); } getChildren(0, 0); System.out.println(dp.get(0).getOrDefault(k, 0L)); } static int getChildren(int idx, int parent) { int count = 1; for (int x : graph.get(idx)) { if (x == parent) { continue; } count += getChildren(x, idx); Integer key = Integer.MAX_VALUE; while ((key = dp.get(idx).lowerKey(key)) != null) { long org = dp.get(idx).get(key); for (int y : dp.get(x).keySet()) { if (y == 0) { continue; } dp.get(idx).put(key + y, (dp.get(idx).getOrDefault(key + y, 0L) + org * dp.get(x).get(y) % MOD) % MOD); } } } dp.get(idx).put(count, 1L); return 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(); } }