#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef pair<ii, ii> iii;
ll MOD = 1e9 + 7;
const ld E = 1e-9;
#define null NULL
#define ms(x) memset(x, 0, sizeof(x))
#ifndef LOCAL
#define endl "\n"
#endif
#ifndef LONG_LONG_MAX
#define LONG_LONG_MAX LLONG_MAX
#endif
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define _read(x) freopen(x, "r", stdin)
#define _write(x) freopen(x, "w", stdout)
#define files(x) _read(x ".in"); _write(x ".out")
#define filesdatsol(x) _read(x ".DAT"); _write(x ".SOL")
#define output _write("output.txt")
#define input _read("input.txt")
#define prev time_prev
#define remove tipa_remove
#define next tipa_next
#define mod % MOD
#define y1 hello_world
unsigned char ccc;
bool _minus = false;
template<typename T>
inline T sqr(T t) {
	return (t * t);
}
inline void read(ll &n) {
	n = 0;
	_minus = false;
	while (true) {
		ccc = getchar();
		if (ccc == ' ' || ccc == '\n')
			break;
		if (ccc == '-') {
			_minus = true;
			continue;
		}
		n = n * 10 + ccc - '0';
	}
	if (_minus)
		n *= -1;
}
inline void read(int &n) {
	n = 0;
	_minus = false;
	while (true) {
		ccc = getchar();
		if (ccc == ' ' || ccc == '\n')
			break;
		if (ccc == '-') {
			_minus = true;
			continue;
		}
		n = n * 10 + ccc - '0';
	}
	if (_minus)
		n *= -1;
}
char wwww[19];
int kkkk;
inline void write(ll y) {
	long long x = y;
	kkkk = 0;
	if (x < 0) {
		putchar('-');
		x *= -1;
	}
	if (!x)
		++kkkk, wwww[kkkk] = '0';
	else
		while (x) {
			++kkkk;
			wwww[kkkk] = char(x % 10 + '0');
			x /= 10;
		}
	for (int i = kkkk; i >= 1; --i)
		putchar(wwww[i]);
}

#ifdef LOCAL
#define DEBUG
#endif

#ifdef DEBUG
#define dbg if(1)
#else
#define dbg if(0)
#endif

const int MAX = 101;
const int MAX_K = 24;
const int K = MAX_K - 1;
vector<int> v[MAX];
ll dp[2][MAX][MAX_K];

inline void upd(ll &a, ll b) {
	a += b;
	a %= MOD;
}

ll dp2[2][MAX][MAX_K];
int n, k;
void dfs(int pos, int prev = -1) {
	for (int i = 0; i < (int) v[pos].size(); i++) {
		if (v[pos][i] == prev) {
			v[pos].erase(v[pos].begin() + i);
			break;
		}
	}
	for (int a : v[pos]) {
		dfs(a, pos);
	}
	//cout << "MS" << endl;
	ms(dp2);
	if (!v[pos].empty()) {
		//cout << "! " << pos << endl;
		int a = v[pos][0];
		for (int i = 0; i < K; i++) {
			//cout << dp[0][a][i] << " $ " << dp[1][a][i] << endl;
			if(i)
				upd(dp2[0][0][i - 1], dp[0][a][i]);
			else
				upd(dp2[1][0][0], dp[0][a][i]);
			upd(dp2[1][0][i + 1], dp[1][a][i]);
		}
		for (int z = 1; z < (int) v[pos].size(); z++) {
			int a = v[pos][z];
			for (int i = 0; i <= k + 1; i++) {
				for (int j = 0; j <= k + 1; j++) {
					upd(dp2[0][z][max(i - 1, j)],
							dp2[0][z - 1][j] * dp[0][a][i]);
					if (i - 1 >= j)
						upd(dp2[0][z][i - 1],
								dp2[1][z - 1][j] * dp[0][a][i]);
					else
						upd(dp2[1][z][j], dp2[1][z - 1][j] * dp[0][a][i]);
				}
			}
			for (int i = 0; i <= k + 1; i++) {
				for (int j = 0; j <= k + 1; j++) {
					upd(dp2[1][z][max(i + 1, j)],
							dp2[1][z - 1][j] * dp[1][a][i]);
					if (i + 1 <= j)
						upd(dp2[0][z][j],
								dp2[0][z - 1][j] * dp[1][a][i]);
					else
						upd(dp2[1][z][i + 1], dp2[0][z - 1][j] * dp[1][a][i]);
				}
			}
		}
		int z = (int) v[pos].size() - 1;
		//cout << pos << " " << z << endl;
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < MAX_K; j++) {
				if(dp2[i][z][j]){
					//cout << i << " " << z << " " << j << " " << dp2[i][z][j] << endl;
				}
				upd(dp[i][pos][j], dp2[i][z][j]);
				if (i) {
					if (j <= k) {
						upd(dp[0][pos][k], dp2[i][z][j]);
					}
				} else {
					upd(dp[0][pos][k], dp2[i][z][j]);
				}
			}
		}
	} else {
		dp[1][pos][0] = 1;
		dp[0][pos][k] = 1;
	}
}

int main() {
	sync;
	srand(time(NULL));
	cout.precision(10);
	cout << fixed;
#ifdef LOCAL
	input;
#else

#endif

	cin >> n >> k;

	for(int i = 1; i < n; i++) {
		int a, b;
		cin >> a >> b;
		v[a].push_back(b);
		v[b].push_back(a);
	}

	dfs(1);

	ll ans = 0;
	for(int i = 0; i <= k; i++) {
		upd(ans, dp[0][1][i]);
	}

	cout << ans << endl;

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef pair<ii, ii> iii;
ll MOD = 1e9 + 7;
const ld E = 1e-9;
#define null NULL
#define ms(x) memset(x, 0, sizeof(x))
#ifndef LOCAL
#define endl "\n"
#endif
#ifndef LONG_LONG_MAX
#define LONG_LONG_MAX LLONG_MAX
#endif
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define _read(x) freopen(x, "r", stdin)
#define _write(x) freopen(x, "w", stdout)
#define files(x) _read(x ".in"); _write(x ".out")
#define filesdatsol(x) _read(x ".DAT"); _write(x ".SOL")
#define output _write("output.txt")
#define input _read("input.txt")
#define prev time_prev
#define remove tipa_remove
#define next tipa_next
#define mod % MOD
#define y1 hello_world
unsigned char ccc;
bool _minus = false;
template<typename T>
inline T sqr(T t) {
	return (t * t);
}
inline void read(ll &n) {
	n = 0;
	_minus = false;
	while (true) {
		ccc = getchar();
		if (ccc == ' ' || ccc == '\n')
			break;
		if (ccc == '-') {
			_minus = true;
			continue;
		}
		n = n * 10 + ccc - '0';
	}
	if (_minus)
		n *= -1;
}
inline void read(int &n) {
	n = 0;
	_minus = false;
	while (true) {
		ccc = getchar();
		if (ccc == ' ' || ccc == '\n')
			break;
		if (ccc == '-') {
			_minus = true;
			continue;
		}
		n = n * 10 + ccc - '0';
	}
	if (_minus)
		n *= -1;
}
char wwww[19];
int kkkk;
inline void write(ll y) {
	long long x = y;
	kkkk = 0;
	if (x < 0) {
		putchar('-');
		x *= -1;
	}
	if (!x)
		++kkkk, wwww[kkkk] = '0';
	else
		while (x) {
			++kkkk;
			wwww[kkkk] = char(x % 10 + '0');
			x /= 10;
		}
	for (int i = kkkk; i >= 1; --i)
		putchar(wwww[i]);
}

#ifdef LOCAL
#define DEBUG
#endif

#ifdef DEBUG
#define dbg if(1)
#else
#define dbg if(0)
#endif

const int MAX = 101;
const int MAX_K = 24;
const int K = MAX_K - 1;
vector<int> v[MAX];
ll dp[2][MAX][MAX_K];

inline void upd(ll &a, ll b) {
	a += b;
	a %= MOD;
}

ll dp2[2][MAX][MAX_K];
int n, k;
void dfs(int pos, int prev = -1) {
	for (int i = 0; i < (int) v[pos].size(); i++) {
		if (v[pos][i] == prev) {
			v[pos].erase(v[pos].begin() + i);
			break;
		}
	}
	for (int a : v[pos]) {
		dfs(a, pos);
	}
	ms(dp2);
	if (!v[pos].empty()) {
		//cout << "! " << pos << endl;
		int a = v[pos][0];
		for (int i = 0; i < K; i++) {
			upd(dp2[0][0][i + 1], dp[0][a][i]);
			upd(dp2[1][0][i + 1], dp[1][a][i]);
		}
		//upd(dp2[1][0][0], dp[0][a][k]);
		for (int z = 1; z < (int) v[pos].size(); z++) {
			int a = v[pos][z];
			for (int i = 0; i < K; i++) {
				for (int j = 0; j < K; j++) {
					upd(dp2[0][z][min(i + 1, j)],
							dp2[0][z - 1][j] * dp[0][a][i]);
					if ((i + j + 1) <= k)
						upd(dp2[0][z][j],
								dp2[1][z - 1][j] * dp[0][a][i]);
					else
						upd(dp2[1][z][j], dp2[1][z - 1][j] * dp[0][a][i]);
				}
			}
			for (int i = 0; i < K; i++) {
				for (int j = 0; j < K; j++) {
					upd(dp2[1][z][max(i + 1, j)],
							dp2[1][z - 1][j] * dp[1][a][i]);
					if ((abs(i + j + 1) <= k))
						upd(dp2[0][z][j],
								dp2[0][z - 1][j] * dp[1][a][i]);
					else
						upd(dp2[1][z][i + 1], dp2[0][z - 1][j] * dp[1][a][i]);
				}
			}
		}
		int z = (int) v[pos].size() - 1;
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < MAX_K; j++) {
				upd(dp[i][pos][j], dp2[i][z][j]);
				if (i) {
					if (j <= k) {
						upd(dp[0][pos][0], dp2[i][z][j]);
					}
				} else {
					upd(dp[0][pos][0], dp2[i][z][j]);
				}
			}
		}
	} else {
		dp[1][pos][0] = 1;
		dp[0][pos][0] = 1;
	}
}

int main() {
	sync;
	srand(time(NULL));
	cout.precision(10);
	cout << fixed;
#ifdef LOCAL
	input;
#else

#endif

	cin >> n >> k;

	for(int i = 1; i < n; i++) {
		int a, b;
		cin >> a >> b;
		v[a].push_back(b);
		v[b].push_back(a);
	}

	dfs(1);

	ll ans = 0;
	for(int i = 0; i <= k; i++) {
		upd(ans, dp[0][1][i]);
	}

	cout << ans << endl;

}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdlib>
#include <set>
#include <queue>
using namespace std;

#define X first
#define Y second
#define Mod 1000000007
#define N 110
#define M 24

typedef long long ll;
typedef pair<int,int> pii;

const ll INF=4e18;

int n,k;
ll f[N][M],g[N][M],tf[M],tg[M];
vector<int> e[N];

void Dfs(int x,int father)
{
	f[x][0]=1; g[x][0]=1;
	for (int c=0;c<e[x].size();c++)
	{
		int y=e[x][c]; if (y==father) continue;

		Dfs(y,x);
		for (int i=0;i<=k;i++) tf[i]=tg[i]=0;

		for (int i=0;i<=k;i++)
		{
			for (int j=0;j<=k;j++)
			{
				(tf[min(i,j+1)]+=f[x][i]*f[y][j])%=Mod;
				if (i+j+1<=k)
				{
					(tf[i]+=f[x][i]*g[y][j])%=Mod;
					(tf[j+1]+=g[x][i]*f[y][j])%=Mod;
				}

				(tg[max(i,j+1)]+=g[x][i]*g[y][j])%=Mod;
				if (i+j+1>k)
				{
					(tg[i]+=g[x][i]*f[y][j])%=Mod;
					(tg[j+1]+=f[x][i]*g[y][j])%=Mod;
				}
			}
		}
		for (int i=0;i<=k;i++) f[x][i]=tf[i],g[x][i]=tg[i];
	}
}

int main()
{
	//freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);

	scanf("%d%d",&n,&k);
	for (int i=1;i<n;i++)
	{
		int x,y; scanf("%d%d",&x,&y);
		e[x].push_back(y);
		e[y].push_back(x);
	}

	if (k==0)  {printf("1\n"); return 0;}

	int ans=0;
	Dfs(1,0);
	for (int i=0;i<=k;i++) ans=(ans+f[1][i])%Mod;
	printf("%d\n",ans);

	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>

using namespace std;

vector<vector<vector<long long> > > dp;
vector<vector<long long> > g;
vector<long long> sum;
int k;
const int mod = 1e9 + 7;

void dfs(int v, int p)
{
	dp[v][0][k] = 1;
	long long x = 1;
	for (int i = 0; i < g[v].size(); i++)
	{
		int to = g[v][i];
		if (to != p)
		{
			dfs(to, v);
			sum[to] = 0;
			vector<vector<long long> > tmp(k + 1, vector<long long>(k + 1, 0));
			int ni, nj;
			for (int a = 0; a <= k; a++)
			{
				for (int b = 0; b <= k; b++)
				{
					for (int c = 0; c <= k; c++)
					{
						if (c == k - 1)
							continue;
						for (int d = 0; d <= k; d++)
						{
							nj = min(b, d + 1);
							ni = max(a, c + 1) <= k ? max(a, c + 1) : k;
							if (a == k && c == k)
							{
								ni = k;
							}
							else {
								if (c == k)
									ni = a;
								else
								{
									if (a == k)
										ni = c+1;
									else
										ni = max(a, c + 1);
								}
							}

							if (d == k - 1 && a == 0 && c == k)
								ni = k;
							if (nj < k && nj + ni <= k)
								ni = k;

							tmp[ni][nj] = (tmp[ni][nj] + dp[v][a][b] * dp[to][c][d]) % mod;
						}
					}
					sum[to] += dp[to][a][b];
					sum[to] %= mod;
				}
			}
			dp[v] = tmp;
			x = (x * sum[to]) % mod;
		}
	}
	dp[v][k][0] = x;
	sum[v] = x;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n >> k;
	int x, y;
	g.resize(n);
	dp.resize(n);
	sum.resize(n);
	for (int i = 0; i < n; i++)
	{
		dp[i].resize(k + 1);
		for (int j = 0; j < dp[i].size(); j++)
			dp[i][j].assign(k + 1, 0);
	}
	for (int i = 0; i < n - 1; i++)
	{
		cin >> x >> y;
		x--;
		y--;
		g[x].push_back(y);
		g[y].push_back(x);
	}

	dfs(0, -1);

	int ans = 0;
	/*for (int i = 0; i <= k; i++)
	{
		for (int j = 0; j <= k; j++)
			ans += dp[0][i][j];
	}*/

	for (int i = 0; i <= k; i++)
		ans += dp[0][k][i];

	cout << ans;

	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>

using namespace std;

vector<vector<vector<long long> > > dp;
vector<vector<long long> > g;
vector<long long> sum;
int k;
const long long mod = 1e9 + 7;

void dfs(int v, int p)
{
	dp[v][0][k] = 1;
	long long x = 1;
	for (int i = 0; i < g[v].size(); i++)
	{
		int to = g[v][i];
		if (to != p)
		{
			dfs(to, v);
			sum[to] = 0;
			vector<vector<long long> > tmp(k + 1, vector<long long>(k + 1, 0));
			int ni, nj;
			for (int a = 0; a <= k; a++)
			{
				for (int b = 0; b <= k; b++)
				{
					for (int c = 0; c <= k; c++)
					{
						if (c == k - 1)
							continue;
						for (int d = 0; d <= k; d++)
						{
							nj = min(b, d + 1);
							ni = max(a, c + 1) <= k ? max(a, c + 1) : k;
							if (a == k && c == k)
							{
								ni = k;
							}
							else {
								if (c == k)
									ni = a;
								else
								{
									if (a == k)
										ni = c+1;
									else
										ni = max(a, c + 1);
								}
							}

							if (d == k - 1 && a == 0 && c == k)
								ni = k;
							if (nj < k && nj + ni <= k)
								ni = k;

							tmp[ni][nj] = (tmp[ni][nj] + dp[v][a][b] * dp[to][c][d]) % mod;
						}
					}
					sum[to] += dp[to][a][b];
					sum[to] %= mod;
				}
			}
			dp[v] = tmp;
			x = (x * sum[to]) % mod;
		}
	}
	dp[v][k][0] = x;
	sum[v] = x;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n >> k;
	int x, y;
	g.resize(n);
	dp.resize(n);
	sum.resize(n);
	for (int i = 0; i < n; i++)
	{
		dp[i].resize(k + 1);
		for (int j = 0; j < dp[i].size(); j++)
			dp[i][j].assign(k + 1, 0);
	}
	for (int i = 0; i < n - 1; i++)
	{
		cin >> x >> y;
		x--;
		y--;
		g[x].push_back(y);
		g[y].push_back(x);
	}

	dfs(0, -1);

	long long ans = 0;
	/*for (int i = 0; i <= k; i++)
	{
		for (int j = 0; j <= k; j++)
			ans += dp[0][i][j];
	}*/

	for (int i = 0; i <= k; i++)
		ans += dp[0][k][i];

	cout << ans;

	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>

using namespace std;

vector<vector<vector<long long> > > dp;
vector<vector<long long> > g;
vector<long long> sum;
int k;
const long long mod = 1e9 + 7;

void dfs(int v, int p)
{
	dp[v][0][k] = 1;
	long long x = 1;
	for (int i = 0; i < g[v].size(); i++)
	{
		int to = g[v][i];
		if (to != p)
		{
			dfs(to, v);
			sum[to] = 0;
			vector<vector<long long> > tmp(k + 1, vector<long long>(k + 1, 0));
			int ni, nj;
			for (int a = 0; a <= k; a++)
			{
				for (int b = 0; b <= k; b++)
				{
					for (int c = 0; c <= k; c++)
					{
						if (c == k - 1)
							continue;
						for (int d = 0; d <= k; d++)
						{
							nj = min(b, d + 1);
							ni = max(a, c + 1) <= k ? max(a, c + 1) : k;
							if (a == k && c == k)
							{
								ni = k;
							}
							else {
								if (c == k)
									ni = a;
								else
								{
									if (a == k)
										ni = c+1;
									else
										ni = max(a, c + 1);
								}
							}

							if (d == k - 1 && a == 0 && c == k)
								ni = k;
							if (nj < k && nj + ni <= k)
								ni = k;

							tmp[ni][nj] = (tmp[ni][nj] + dp[v][a][b] * dp[to][c][d]) % mod;
						}
					}
					sum[to] += dp[to][a][b];
					sum[to] %= mod;
				}
			}
			dp[v] = tmp;
			x = (x * sum[to]) % mod;
		}
	}
	dp[v][k][0] = x;
	sum[v] = x;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n >> k;
	int x, y;
	g.resize(n);
	dp.resize(n);
	sum.resize(n);
	for (int i = 0; i < n; i++)
	{
		dp[i].resize(k + 1);
		for (int j = 0; j < dp[i].size(); j++)
			dp[i][j].assign(k + 1, 0);
	}
	for (int i = 0; i < n - 1; i++)
	{
		cin >> x >> y;
		x--;
		y--;
		g[x].push_back(y);
		g[y].push_back(x);
	}

	dfs(0, -1);

	long long ans = 0;
	/*for (int i = 0; i <= k; i++)
	{
		for (int j = 0; j <= k; j++)
			ans += dp[0][i][j];
	}*/

	for (int i = 0; i <= k; i++)
	{
		ans += dp[0][k][i];
		ans %= mod;
	}

	cout << ans;

	return 0;
}


#include <bits/stdc++.h>

#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define forn(i, n) for(int i = 0; i < (int)(n); ++i)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; --i)
#define for1(i, n) for(int i = 1; i <= (int)(n); ++i)

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<long long> vll;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const ld PI = 3.1415926535897932384626433832795L;

template<class T>
bool uin(T &, const T &);

template<class T>
bool uax(T &, const T &);

template<class T>
T gcd(T, T);

template<class T>
T lcm(T, T);

template<class _T>
inline string tostr(const _T &);

template<typename T>
void input(T &);

class range  {
    using type = long long;
public:
    class iterator {
        friend class range;
    public:
        using difference_type = range::type;
        using value_type = range::type;
        using pointer = const range::type*;
        using reference = const range::type&;
        using iterator_category = std::random_access_iterator_tag;

        value_type operator*() const { return i_; }
        const iterator &operator++() { ++i_ ;return *this; }
        iterator operator++(int) { iterator copy(*this); ++i_; return copy; }
        const iterator &operator--() { --i_; return *this; }
        iterator operator--(int) { iterator copy(*this); --i_; return copy; }
        difference_type operator-(const iterator &other) const { return i_ - other.i_; }
        iterator operator+(const difference_type &delta) const { return iterator(i_ + delta); }
        iterator &operator+=(const difference_type &delta) { i_ += delta; return *this; }
        iterator operator-(const difference_type &delta) const { return iterator(i_ - delta); }
        iterator &operator-=(const difference_type &delta) { i_ -= delta; return *this; }
        bool operator==(const iterator &other) const { return i_ == other.i_; }
        bool operator!=(const iterator &other) const { return i_ != other.i_; }
    protected:
        iterator(const value_type &start) : i_(start) {}
    private:
        value_type i_;
    };

    iterator begin() const { return begin_; }
    iterator end() const { return end_; }
    range(const type &begin, const type &end) : begin_(begin), end_(end) {}
    range(const type &end) : begin_(0), end_(end) {}

private:
    iterator begin_;
    iterator end_;
};

template<typename T = long long>
T nxt();

bool checkp(long long);

template<typename T>
T pw(T a, T n, T p);

template<typename T>
T inv(T a, T p);

template<class _T>
_T sqr(const _T &x);

class range;

mt19937 gen;

void pre() {

}

ll dp[101][22][22];

ll qp[101];

vector <int> g[100];

int k;

ll mod = 1000000007;

void dfs(int v, int p) {

    for (int to : g[v]) {
        if (to == p) continue;
        dfs(to, v);
    }

    //not take

    dp[v][0][1] = 1;

    qp[v] = 1;

    for (int to : g[v]) {
        if (to == p) continue;

        ll tmp[22][22];
        clr(tmp);

        for (int up = -1; up <= k; ++up) {
            for (int down = -1; down <= k; ++down) {
                for (int u = -1; u <= k; ++u) {
                    for (int d = -1; d <= k; ++d) {
                        int pu = u - 1;
                        int pd = d + 1;

                        int nu = max(pu, up);
                        int nd = max(up, pu) >= 0 ? -1 : 0;

                        if (pu < down) nd = max(nd, down);
                        if (up < pd) nd = max(nd, pd);

                        if (nd <= k) {
                            tmp[nu + 1][nd + 1] += dp[v][up + 1][down + 1] * dp[to][u + 1][d + 1];
                            tmp[nu + 1][nd + 1] %= mod;
                        }
                    }
                }
                //qp
                int uu = max(up, k - 1);
                int dd = -1;
                if (down > k - 1) dd = down;

                tmp[uu + 1][dd + 1] += dp[v][up + 1][down + 1] * qp[to];
                tmp[uu + 1][dd + 1] %= mod;
            }
        }
        memcpy(dp[v], tmp, sizeof(tmp));

        ll z = 0;

        for (int u = -1; u <= k; ++u) {
            for (int d = -1; d <= k; ++d) {
                if (d + 1 <= k) {
                    z += qp[v] * dp[to][u + 1][d + 1];
                    z %= mod;
                }
            }
        }

        z += qp[v] * qp[to];
        z %= mod;

        qp[v] = z;

    }

//    cerr << "! " << v << " " << qp[v] << endl;
//    forn(i, k + 1) {
//        forn(j, k + 1) {
//            cerr << dp[v][i][j] << " ";
//        }
//        cerr << endl;
//    }

}

void solve(int test) {
    int n = nxt();
    k = nxt();

    forn(i, n - 1) {
        int u = nxt() - 1;
        int v = nxt() - 1;
        g[u].pb(v);
        g[v].pb(u);
    }

    dfs(0, 0);

    ll ans = qp[0];

    cerr << qp[0] << endl;

    for (int i = 0; i <= k; ++i) {
        ans += dp[0][i][0];
    }

    ans %= mod;

    cout << ans << endl;
}

int main(int argc, char **argv) {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
#else
    #define fname "sequence"
    //freopen(fname".in", "r", stdin);
    //freopen(fname".out", "w", stdout);
#endif
    pre();
    int t = 1;
#ifdef LOCAL
#else
#endif
    for (int test = 1; test <= t; ++test) {
        solve(test);
    }

#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC * 1000 << " ms." << endl;
#endif
    return 0;
}

template<typename T>
T gcd(T x, T y) {
    while (y > 0) {
        x %= y;
        swap(x, y);
    }
    return x;
}

template<class T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

template<class _T>
inline _T sqr(const _T &x) {
    return x * x;
}

template<class _T>
inline string tostr(const _T &a) {
    ostringstream os("");
    os << a;
    return os.str();
}

template<typename T>
inline void input(T &a) {
    static int ed;
    a = 0;
    while (!isdigit(ed = getchar()) && ed != '-') {}
    char neg = 0;
    if (ed == '-') {
        neg = 1;
        ed = getchar();
    }
    while (isdigit(ed)) {
        a = 10 * a + ed - '0';
        ed = getchar();
    }
    if (neg) a = -a;
}

template<typename T = long long>
inline T nxt() {
    T res;
    input(res);
    return res;
}

void myassert(bool v) {
    assert(v);
//cout << "FAIL\n";
//exit(0);
}

mt19937 generator;

bool checkp(long long v) {
    if (v < 2) return false;
    for (long long i = 2; i * i <= v; ++i) {
        if (v % i == 0) {
            return false;
        }
    }
    return true;
}

template<typename T>
T pw(T a, T n, T m) {
    T res = 1;
    while (n) {
        if (n & 1) {
            res = res * a % m;
        }
        a = a * a % m;
        n >>= 1;
    }
    return res;
}

template<typename T>
T inv(T a, T p) {
    T res = 1;
    while (a > 1) {
        res = res * (p - p / a) % p;
        a = p % a;
    }
    return res;
}

template<class T>
bool uin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool uax(T &a, const T &b) {
    if (b > a) {
        a = b;
        return true;
    }
    return false;
}


#include <bits/stdc++.h>

#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define forn(i, n) for(int i = 0; i < (int)(n); ++i)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; --i)
#define for1(i, n) for(int i = 1; i <= (int)(n); ++i)

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<long long> vll;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const ld PI = 3.1415926535897932384626433832795L;

template<class T>
bool uin(T &, const T &);

template<class T>
bool uax(T &, const T &);

template<class T>
T gcd(T, T);

template<class T>
T lcm(T, T);

template<class _T>
inline string tostr(const _T &);

template<typename T>
void input(T &);

class range  {
    using type = long long;
public:
    class iterator {
        friend class range;
    public:
        using difference_type = range::type;
        using value_type = range::type;
        using pointer = const range::type*;
        using reference = const range::type&;
        using iterator_category = std::random_access_iterator_tag;

        value_type operator*() const { return i_; }
        const iterator &operator++() { ++i_ ;return *this; }
        iterator operator++(int) { iterator copy(*this); ++i_; return copy; }
        const iterator &operator--() { --i_; return *this; }
        iterator operator--(int) { iterator copy(*this); --i_; return copy; }
        difference_type operator-(const iterator &other) const { return i_ - other.i_; }
        iterator operator+(const difference_type &delta) const { return iterator(i_ + delta); }
        iterator &operator+=(const difference_type &delta) { i_ += delta; return *this; }
        iterator operator-(const difference_type &delta) const { return iterator(i_ - delta); }
        iterator &operator-=(const difference_type &delta) { i_ -= delta; return *this; }
        bool operator==(const iterator &other) const { return i_ == other.i_; }
        bool operator!=(const iterator &other) const { return i_ != other.i_; }
    protected:
        iterator(const value_type &start) : i_(start) {}
    private:
        value_type i_;
    };

    iterator begin() const { return begin_; }
    iterator end() const { return end_; }
    range(const type &begin, const type &end) : begin_(begin), end_(end) {}
    range(const type &end) : begin_(0), end_(end) {}

private:
    iterator begin_;
    iterator end_;
};

template<typename T = long long>
T nxt();

bool checkp(long long);

template<typename T>
T pw(T a, T n, T p);

template<typename T>
T inv(T a, T p);

template<class _T>
_T sqr(const _T &x);

class range;

mt19937 gen;

void pre() {

}

ll dp[101][22][22];

ll qp[101];

vector <int> g[100];

int k;

ll mod = 1000000007;

void dfs(int v, int p) {

    for (int to : g[v]) {
        if (to == p) continue;
        dfs(to, v);
    }

    //not take

    dp[v][-1 + 1][0 + 1] = 1;

    qp[v] = 1;

    for (int to : g[v]) {
        if (to == p) continue;

        ll tmp[22][22];
        clr(tmp);

        for (int up = -1; up <= k; ++up) {
            for (int down = -1; down <= k; ++down) {
                for (int u = -1; u <= k; ++u) {
                    for (int d = -1; d <= k; ++d) {
                        int pu = u - 1;
                        int pd = d + 1;

                        int nu = max(pu, up);
                        int nd = max(up, pu) >= 0 ? -1 : 0;

                        if (pu < down && down != -1) nd = max(nd, down);
                        if (up < pd && d != -1) nd = max(nd, pd);

                        if (nd <= k) {
                            tmp[nu + 1][nd + 1] += dp[v][up + 1][down + 1] * dp[to][u + 1][d + 1];
                            tmp[nu + 1][nd + 1] %= mod;
                        }
                    }
                }
                //qp
                int uu = max(up, k - 1);
                int dd = -1;
                if (down > k - 1) dd = down;

                tmp[uu + 1][dd + 1] += dp[v][up + 1][down + 1] * qp[to];
                tmp[uu + 1][dd + 1] %= mod;
            }
        }
        memcpy(dp[v], tmp, sizeof(tmp));

        ll z = 0;

        for (int u = -1; u <= k; ++u) {
            for (int d = -1; d <= k; ++d) {
                if (d + 1 <= k) {
                    z += qp[v] * dp[to][u + 1][d + 1];
                    z %= mod;
                }
            }
        }

        z += qp[v] * qp[to];
        z %= mod;

        qp[v] = z;

    }

//    cerr << "! " << v << " " << qp[v] << endl;
//    forn(i, k + 1) {
//        forn(j, k + 1) {
//            cerr << dp[v][i][j] << " ";
//        }
//        cerr << endl;
//    }

}

void solve(int test) {
    int n = nxt();
    k = nxt();

    if (k == 0) {
        cout << 1 << "\n";
        return;
    }

    forn(i, n - 1) {
        int u = nxt() - 1;
        int v = nxt() - 1;
        g[u].pb(v);
        g[v].pb(u);
    }

    dfs(0, 0);

    ll ans = qp[0];

    cerr << qp[0] << endl;

    for (int i = -1; i <= k; ++i) {
        ans += dp[0][i + 1][0];
    }

    ans %= mod;

    cout << ans << endl;
}

int main(int argc, char **argv) {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
#else
    #define fname "sequence"
    //freopen(fname".in", "r", stdin);
    //freopen(fname".out", "w", stdout);
#endif
    pre();
    int t = 1;
#ifdef LOCAL
#else
#endif
    for (int test = 1; test <= t; ++test) {
        solve(test);
    }

#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC * 1000 << " ms." << endl;
#endif
    return 0;
}

template<typename T>
T gcd(T x, T y) {
    while (y > 0) {
        x %= y;
        swap(x, y);
    }
    return x;
}

template<class T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

template<class _T>
inline _T sqr(const _T &x) {
    return x * x;
}

template<class _T>
inline string tostr(const _T &a) {
    ostringstream os("");
    os << a;
    return os.str();
}

template<typename T>
inline void input(T &a) {
    static int ed;
    a = 0;
    while (!isdigit(ed = getchar()) && ed != '-') {}
    char neg = 0;
    if (ed == '-') {
        neg = 1;
        ed = getchar();
    }
    while (isdigit(ed)) {
        a = 10 * a + ed - '0';
        ed = getchar();
    }
    if (neg) a = -a;
}

template<typename T = long long>
inline T nxt() {
    T res;
    input(res);
    return res;
}

void myassert(bool v) {
    assert(v);
//cout << "FAIL\n";
//exit(0);
}

mt19937 generator;

bool checkp(long long v) {
    if (v < 2) return false;
    for (long long i = 2; i * i <= v; ++i) {
        if (v % i == 0) {
            return false;
        }
    }
    return true;
}

template<typename T>
T pw(T a, T n, T m) {
    T res = 1;
    while (n) {
        if (n & 1) {
            res = res * a % m;
        }
        a = a * a % m;
        n >>= 1;
    }
    return res;
}

template<typename T>
T inv(T a, T p) {
    T res = 1;
    while (a > 1) {
        res = res * (p - p / a) % p;
        a = p % a;
    }
    return res;
}

template<class T>
bool uin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool uax(T &a, const T &b) {
    if (b > a) {
        a = b;
        return true;
    }
    return false;
}


#include <bits/stdc++.h>

#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define forn(i, n) for(int i = 0; i < (int)(n); ++i)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; --i)
#define for1(i, n) for(int i = 1; i <= (int)(n); ++i)

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<long long> vll;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const ld PI = 3.1415926535897932384626433832795L;

template<class T>
bool uin(T &, const T &);

template<class T>
bool uax(T &, const T &);

template<class T>
T gcd(T, T);

template<class T>
T lcm(T, T);

template<class _T>
inline string tostr(const _T &);

template<typename T>
void input(T &);

class range  {
    using type = long long;
public:
    class iterator {
        friend class range;
    public:
        using difference_type = range::type;
        using value_type = range::type;
        using pointer = const range::type*;
        using reference = const range::type&;
        using iterator_category = std::random_access_iterator_tag;

        value_type operator*() const { return i_; }
        const iterator &operator++() { ++i_ ;return *this; }
        iterator operator++(int) { iterator copy(*this); ++i_; return copy; }
        const iterator &operator--() { --i_; return *this; }
        iterator operator--(int) { iterator copy(*this); --i_; return copy; }
        difference_type operator-(const iterator &other) const { return i_ - other.i_; }
        iterator operator+(const difference_type &delta) const { return iterator(i_ + delta); }
        iterator &operator+=(const difference_type &delta) { i_ += delta; return *this; }
        iterator operator-(const difference_type &delta) const { return iterator(i_ - delta); }
        iterator &operator-=(const difference_type &delta) { i_ -= delta; return *this; }
        bool operator==(const iterator &other) const { return i_ == other.i_; }
        bool operator!=(const iterator &other) const { return i_ != other.i_; }
    protected:
        iterator(const value_type &start) : i_(start) {}
    private:
        value_type i_;
    };

    iterator begin() const { return begin_; }
    iterator end() const { return end_; }
    range(const type &begin, const type &end) : begin_(begin), end_(end) {}
    range(const type &end) : begin_(0), end_(end) {}

private:
    iterator begin_;
    iterator end_;
};

template<typename T = long long>
T nxt();

bool checkp(long long);

template<typename T>
T pw(T a, T n, T p);

template<typename T>
T inv(T a, T p);

template<class _T>
_T sqr(const _T &x);

class range;

mt19937 gen;

void pre() {

}

ll dp[101][22][22];

ll qp[101];

vector <int> g[100];

int k;

ll mod = 1000000007;

void dfs(int v, int p) {

    for (int to : g[v]) {
        if (to == p) continue;
        dfs(to, v);
    }

    //not take

    dp[v][0][1] = 1;

    qp[v] = 1;

    for (int to : g[v]) {
        if (to == p) continue;

        ll tmp[22][22];
        clr(tmp);

        for (int up = -1; up <= k; ++up) {
            for (int down = -1; down <= k; ++down) {
                for (int u = -1; u <= k; ++u) {
                    for (int d = -1; d <= k; ++d) {
                        int pu = u - 1;
                        int pd = d + 1;

                        int nu = max(pu, up);
                        int nd = max(up, pu) >= 0 ? -1 : 0;

                        if (pu < down) nd = max(nd, down);
                        if (up < pd) nd = max(nd, pd);

                        if (nd <= k) {
                            tmp[nu + 1][nd + 1] += dp[v][up + 1][down + 1] * dp[to][u + 1][d + 1];
                            tmp[nu + 1][nd + 1] %= mod;
                        }
                    }
                }
                //qp
                int uu = max(up, k - 1);
                int dd = -1;
                if (down > k - 1) dd = down;

                tmp[uu + 1][dd + 1] += dp[v][up + 1][down + 1] * qp[to];
                tmp[uu + 1][dd + 1] %= mod;
            }
        }
        memcpy(dp[v], tmp, sizeof(tmp));

        ll z = 0;

        for (int u = -1; u <= k; ++u) {
            for (int d = -1; d <= k; ++d) {
                if (d + 1 <= k) {
                    z += qp[v] * dp[to][u + 1][d + 1];
                    z %= mod;
                }
            }
        }

        z += qp[v] * qp[to];
        z %= mod;

        qp[v] = z;

    }

//    cerr << "! " << v << " " << qp[v] << endl;
//    forn(i, k + 1) {
//        forn(j, k + 1) {
//            cerr << dp[v][i][j] << " ";
//        }
//        cerr << endl;
//    }

}

void solve(int test) {
    int n = nxt();
    k = nxt();

    forn(i, n - 1) {
        int u = nxt() - 1;
        int v = nxt() - 1;
        g[u].pb(v);
        g[v].pb(u);
    }

    dfs(0, 0);

    ll ans = qp[0];

    cerr << qp[0] << endl;

    for (int i = -1; i <= k; ++i) {
        ans += dp[0][i + 1][0];
    }

    ans %= mod;

    cout << ans << endl;
}

int main(int argc, char **argv) {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
#else
    #define fname "sequence"
    //freopen(fname".in", "r", stdin);
    //freopen(fname".out", "w", stdout);
#endif
    pre();
    int t = 1;
#ifdef LOCAL
#else
#endif
    for (int test = 1; test <= t; ++test) {
        solve(test);
    }

#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC * 1000 << " ms." << endl;
#endif
    return 0;
}

template<typename T>
T gcd(T x, T y) {
    while (y > 0) {
        x %= y;
        swap(x, y);
    }
    return x;
}

template<class T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

template<class _T>
inline _T sqr(const _T &x) {
    return x * x;
}

template<class _T>
inline string tostr(const _T &a) {
    ostringstream os("");
    os << a;
    return os.str();
}

template<typename T>
inline void input(T &a) {
    static int ed;
    a = 0;
    while (!isdigit(ed = getchar()) && ed != '-') {}
    char neg = 0;
    if (ed == '-') {
        neg = 1;
        ed = getchar();
    }
    while (isdigit(ed)) {
        a = 10 * a + ed - '0';
        ed = getchar();
    }
    if (neg) a = -a;
}

template<typename T = long long>
inline T nxt() {
    T res;
    input(res);
    return res;
}

void myassert(bool v) {
    assert(v);
//cout << "FAIL\n";
//exit(0);
}

mt19937 generator;

bool checkp(long long v) {
    if (v < 2) return false;
    for (long long i = 2; i * i <= v; ++i) {
        if (v % i == 0) {
            return false;
        }
    }
    return true;
}

template<typename T>
T pw(T a, T n, T m) {
    T res = 1;
    while (n) {
        if (n & 1) {
            res = res * a % m;
        }
        a = a * a % m;
        n >>= 1;
    }
    return res;
}

template<typename T>
T inv(T a, T p) {
    T res = 1;
    while (a > 1) {
        res = res * (p - p / a) % p;
        a = p % a;
    }
    return res;
}

template<class T>
bool uin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool uax(T &a, const T &b) {
    if (b > a) {
        a = b;
        return true;
    }
    return false;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long ll;
#define rep(i, a, b) for (int i = a; i <= b; ++ i)
const int maxn = 110;
const int mo = 1000000007;
using namespace std;
ll tr[maxn][22][22], f[maxn][22][22];
int n, m, e, ter[maxn << 1], nxt[maxn << 1], lnk[maxn], d[maxn];
void _put(int p, int x, int y, ll ave) {
	if (!y) tr[p][x][y] = (tr[p][x][y] + ave) % mo; else
	for ( ; y <= m + 1; y += y & (- y)) tr[p][x][y] = (tr[p][x][y] + ave) % mo;
}
void put(int p, int x, int y, ll ave) {
	if (!x) _put(p, x, y, ave); else
	for ( ; x <= m + 1; x += x & (- x)) _put(p, x, y, ave);
}
ll _get(int p, int x, int y) {
	if (y < 0) return 0;
	ll ret = tr[p][x][0];
	if (!y) return ret;
	for ( ; y; y -= y & (- y)) ret = (ret + tr[p][x][y]) % mo;
	return ret;
}
ll get(int p, int x, int y) {
	if (x < 0) return 0;
	ll ret = _get(p, 0, y);
	if (!x) return ret; else
	for ( ; x; x -= x & (- x)) ret = (ret + _get(p, x, y)) % mo;
	return ret;
}
void add(int x, int y) {
	ter[++ e] = y, nxt[e] = lnk[x], lnk[x] = e;
	ter[++ e] = x, nxt[e] = lnk[y], lnk[y] = e;
}
void dfs(int p, int las) {
	for (int i = lnk[p]; i; i = nxt[i])
		if (ter[i] != las) dfs(ter[i], p);
	d[0] = 0;
	for (int i = lnk[p]; i; i = nxt[i]) if (ter[i] != las) d[++ d[0]] = ter[i];
	if (!d[0]) {
		f[p][0][0] = f[p][m + 1][1] = 1;
		put(p, 0, 0, 1), put(p, m + 1, 1, 1);
		return ;
	}
	rep(i, 1, m) {
		f[p][i][0] = 1;
		rep(j, 1, d[0]) f[p][i][0] = f[p][i][0] * (get(d[j], m + 1, m - i) - get(d[j], i - 2, m - i)) % mo;
		ll ret = 1;
		rep(j, 1, d[0]) ret = ret * (get(d[j], m + 1, m - i) - get(d[j], i - 1, m - i)) % mo;
		f[p][i][0] = (f[p][i][0] - ret) % mo;
		rep(j, m - i + 2, m) {
			f[p][i][j] = ret = 1;
			rep(k, 1, d[0]) f[p][i][j] = f[p][i][j] * (get(d[k], m + 1, j - 1) - get(d[k], i - 2, j - 1)) % mo,
				ret = ret * (get(d[k], m + 1, j - 1) - get(d[k], i - 1, j - 1)) % mo;
			f[p][i][j] = (f[p][i][j] - ret - f[p][i][j - 1]) % mo;
		}
	}
	f[p][m + 1][0] = 0;
	rep(i, 1, m) {
		f[p][m + 1][i] = 1;
		rep(j, 1, d[0]) f[p][m + 1][i] = f[p][m + 1][i] * (get(d[j], m + 1, i - 1) - get(d[j], m - 1, i - 1)) % mo;
		f[p][m + 1][i] = (f[p][m + 1][i] - f[p][m + 1][i - 1]) % mo;
	}
	f[p][0][0] = 1;
	rep(i, 1, d[0]) f[p][0][0] = f[p][0][0] * get(d[i], m + 1, m) % mo;
	put(p, 0, 0, f[p][0][0]);
	rep(i, 1, m + 1) rep(j, 0, m) put(p, i, j, f[p][i][j]);
}
int main() {
	scanf("%d%d", &n, &m); int x, y;
	rep(i, 1, n - 1) scanf("%d%d", &x, &y), add(x, y);
	dfs(1, 0);
	printf("%lld\n", (get(1, m + 1, 0) + mo) % mo);
	return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long ll;
#define rep(i, a, b) for (int i = a; i <= b; ++ i)
const int maxn = 110;
const int mo = 1000000007;
using namespace std;
ll tr[maxn][22][22], f[maxn][22][22];
int n, m, e, ter[maxn << 1], nxt[maxn << 1], lnk[maxn], d[maxn];
void _put(int p, int x, int y, ll ave) {
	if (!y) tr[p][x][y] = (tr[p][x][y] + ave) % mo; else
	for ( ; y <= m + 1; y += y & (- y)) tr[p][x][y] = (tr[p][x][y] + ave) % mo;
}
void put(int p, int x, int y, ll ave) {
	if (!x) _put(p, x, y, ave); else
	for ( ; x <= m + 1; x += x & (- x)) _put(p, x, y, ave);
}
ll _get(int p, int x, int y) {
	if (y < 0) return 0;
	ll ret = tr[p][x][0];
	if (!y) return ret;
	for ( ; y; y -= y & (- y)) ret = (ret + tr[p][x][y]) % mo;
	return ret;
}
ll get(int p, int x, int y) {
	if (x < 0) return 0;
	ll ret = _get(p, 0, y);
	if (!x) return ret; else
	for ( ; x; x -= x & (- x)) ret = (ret + _get(p, x, y)) % mo;
	return ret;
}
void add(int x, int y) {
	ter[++ e] = y, nxt[e] = lnk[x], lnk[x] = e;
	ter[++ e] = x, nxt[e] = lnk[y], lnk[y] = e;
}
void dfs(int p, int las) {
	for (int i = lnk[p]; i; i = nxt[i])
		if (ter[i] != las) dfs(ter[i], p);
	d[0] = 0;
	for (int i = lnk[p]; i; i = nxt[i]) if (ter[i] != las) d[++ d[0]] = ter[i];
	if (!d[0]) {
		f[p][0][0] = f[p][m + 1][1] = 1;
		put(p, 0, 0, 1), put(p, m + 1, 1, 1);
		return ;
	}
	rep(i, 1, m) {
		f[p][i][0] = 1;
		rep(j, 1, d[0]) f[p][i][0] = f[p][i][0] * (get(d[j], m + 1, m - i) - get(d[j], i - 2, m - i)) % mo;
		ll ret = 1, ret2, ret3;
		rep(j, 1, d[0]) ret = ret * (get(d[j], m + 1, m - i) - get(d[j], i - 1, m - i)) % mo;
		f[p][i][0] = (f[p][i][0] - ret) % mo;
		rep(j, m - i + 2, m) {
			f[p][i][j] = ret = ret2 = ret3 = 1;
			rep(k, 1, d[0])
				f[p][i][j] = f[p][i][j] * (get(d[k], m + 1, j - 1) - get(d[k], i - 2, j - 1)) % mo,
				ret = ret * (get(d[k], m + 1, j - 1) - get(d[k], i - 1, j - 1)) % mo,
				ret2 = ret2 * (get(d[k], m + 1, j - 2) - get(d[k], i - 2, j - 2)) % mo,
				ret3 = ret3 * (get(d[k], m + 1, j - 2) - get(d[k], i - 1, j - 2)) % mo;
			f[p][i][j] = (f[p][i][j] - ret - ret2 + ret3) % mo;
		}
	}
	f[p][m + 1][0] = 0;
	rep(i, 1, m) {
		f[p][m + 1][i] = 1; ll ret = 1;
		rep(j, 1, d[0]) f[p][m + 1][i] = f[p][m + 1][i] * (get(d[j], m + 1, i - 1) - get(d[j], m - 1, i - 1)) % mo,
			ret = ret * (get(d[j], m + 1, i - 2) - get(d[j], m - 1, i - 2)) % mo;
		f[p][m + 1][i] = (f[p][m + 1][i] - ret) % mo;
	}
	f[p][0][0] = 1;
	rep(i, 1, d[0]) f[p][0][0] = f[p][0][0] * get(d[i], m + 1, m) % mo;
	put(p, 0, 0, f[p][0][0]);
	rep(i, 1, m + 1) rep(j, 0, m) put(p, i, j, f[p][i][j]);
}
int main() {
	scanf("%d%d", &n, &m); int x, y;
	rep(i, 1, n - 1) scanf("%d%d", &x, &y), add(x, y);
	dfs(1, 0);
	printf("%lld\n", (get(1, m + 1, 0) + mo) % mo);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <numeric>
#include <cmath>
#include <queue>
#include <unordered_map>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)

typedef long long ll;

const int MOD=1000000007;
const int MAXN=101;
const int MAXK=20;

int hd[MAXN];
int nxt[2*MAXN];
int to[2*MAXN];
int ecnt;
int n,k;

ll dp[2*MAXN][MAXK+2][MAXK+2];

void add_edge(int a, int b)
{
	to[ecnt]=b;
	nxt[ecnt]=hd[a];
	hd[a]=ecnt;
	ecnt++;

	to[ecnt]=a;
	nxt[ecnt]=hd[b];
	hd[b]=ecnt;
	ecnt++;
}

ll solveVertex(int curv, int p, int req, int cur);

ll solveEdge(int cure, int p, int req, int cur)
{
	if(cur<req) return 0;
	if(cure==-1)
		return req==cur;
//	if(dp[cure][req][cur]==-1)
	{
		ll &res=dp[cure][req][cur];
		res=0;
		if(to[cure]==p)
			res=solveEdge(nxt[cure], p, req, cur);
		else
		{
			for(int nreq=0;nreq<=k;nreq++)
				res=(res+solveEdge(nxt[cure], p, req, min(cur, nreq+1))*
					solveVertex(to[cure], to[cure^1], nreq, min(req+1, k+1))%MOD)%MOD;
		}
	}
	return dp[cure][req][cur];
}

ll solveVertex(int curv, int p, int req, int cur)
{
	return (solveEdge(hd[curv], p, req, cur) + solveEdge(hd[curv], p, req, 0))%MOD;
}

int main()
{
	scanf("%d%d",&n,&k);
	memset(hd,-1,sizeof(hd));
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		scanf("%d%d",&a,&b);
		a--;
		b--;
		add_edge(a,b);
	}
	memset(dp,-1,sizeof(dp));
	ll res=0;
	for(int i=0;i<=k;i++)
		res=(res+solveVertex(0,-1,i,k+1))%MOD;
	cout<<res<<endl;
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <numeric>
#include <cmath>
#include <queue>
#include <unordered_map>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)

typedef long long ll;

const int MOD=1000000007;
const int MAXN=101;
const int MAXK=20;

int hd[MAXN];
int nxt[2*MAXN];
int to[2*MAXN];
int ecnt;
int n,k;

ll dp[2*MAXN][MAXK+2][MAXK+2];

void add_edge(int a, int b)
{
	to[ecnt]=b;
	nxt[ecnt]=hd[a];
	hd[a]=ecnt;
	ecnt++;

	to[ecnt]=a;
	nxt[ecnt]=hd[b];
	hd[b]=ecnt;
	ecnt++;
}

ll solveVertex(int curv, int p, int req, int cur);

ll solveEdge(int cure, int p, int req, int cur)
{
	if(cur<req) return 0;
	if(cure==-1)
		return req==cur;
	if(dp[cure][req][cur]==-1)
	{
		ll &res=dp[cure][req][cur];
		res=0;
		if(to[cure]==p)
			res=solveEdge(nxt[cure], p, req, cur);
		else
		{
			for(int nreq=0;nreq<=k;nreq++)
				res=(res+solveEdge(nxt[cure], p, req, min(cur, nreq+1))*
					solveVertex(to[cure], to[cure^1], nreq, min(req+1, k+1))%MOD)%MOD;
		}
	}
	return dp[cure][req][cur];
}

ll solveVertex(int curv, int p, int req, int cur)
{
	return (solveEdge(hd[curv], p, req, cur) + solveEdge(hd[curv], p, req, 0))%MOD;
}

int main()
{
	scanf("%d%d",&n,&k);
	memset(hd,-1,sizeof(hd));
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		scanf("%d%d",&a,&b);
		a--;
		b--;
		add_edge(a,b);
	}
	memset(dp,-1,sizeof(dp));
	ll res=0;
	for(int i=0;i<=k;i++)
		res=(res+solveVertex(0,-1,i,k+1))%MOD;
	cout<<res<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n, k;

vector <int> graf[1007];

long long dp[1007][1007];

long long dpl[1007][1007];

long long mod=1000000007;

void dod(long long &a, long long b)
{
	a=(a+b)%mod;
}

void dfs(int v, int oj)
{
	for (int i=0; i<graf[v].size(); i++)
	{
		if (graf[v][i]==oj)
		{
			swap(graf[v][i], graf[v].back());
			graf[v].pop_back();
			i--;
			continue;
		}
		dfs(graf[v][i], v);
	}
	for (int i=0; i<=n*2; i++)
		for (int j=0; j<=n*2; j++)
			dpl[i][j]=0;
	dpl[0][k+1]=1;
	for (int i=0; i<graf[v].size(); i++)
	{
		int u=graf[v][i];
		for (int j=0; j<=2*k+1; j++)
		{
			for (int l=0; l<=2*k+1; l++)
			{
				if (j+l+1<=2*k+1)
				{
					dod(dpl[i+1][min(j, l+1)], dpl[i][j]*dp[u][l]);
				}
				else
				{
					dod(dpl[i+1][max(j, l+1)], dpl[i][j]*dp[u][l]);
				}
			}
		}
	}
	for (int i=0; i<=2*k+1; i++)
	{
		dod(dp[v][i], dpl[graf[v].size()][i]);
		dod(dp[v][0], dpl[graf[v].size()][i]);
	}
}

int main()
{
	scanf("%d%d", &n, &k);
	for (int i=1; i<n; i++)
	{
		int p1, p2;
		scanf("%d%d", &p1, &p2);
		graf[p1].push_back(p2);
		graf[p2].push_back(p1);
	}
	dfs(1, 0);
	long long w=0;
	for (int i=0; i<=k; i++)
		dod(w, dp[1][i]);
	printf("%lld\n", w);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n, k;

vector <int> graf[1007];

long long dp[107][107];

long long dpl[107][107];

long long mod=1000000007;

void dod(long long &a, long long b)
{
	a=(a+b)%mod;
}

void dfs(int v, int oj)
{
	for (int i=0; i<graf[v].size(); i++)
	{
		if (graf[v][i]==oj)
		{
			swap(graf[v][i], graf[v].back());
			graf[v].pop_back();
			i--;
			continue;
		}
		dfs(graf[v][i], v);
	}
	for (int i=0; i<=n; i++)
		for (int j=0; j<=n; j++)
			dpl[i][j]=0;
	dpl[0][k+1]=1;
	for (int i=0; i<graf[v].size(); i++)
	{
		int u=graf[v][i];
		for (int j=0; j<=2*k+1; j++)
		{
			for (int l=0; l<=2*k+1; l++)
			{
				if (j+l+1<=2*k+1)
				{
					dod(dpl[i+1][min(j, l+1)], dpl[i][j]*dp[u][l]);
				}
				else
				{
					dod(dpl[i+1][max(j, l+1)], dpl[i][j]*dp[u][l]);
				}
			}
		}
	}
	for (int i=0; i<=2*k+1; i++)
	{
		dod(dp[v][i], dpl[graf[v].size()][i]);
		dod(dp[v][0], dpl[graf[v].size()][i]);
	}
}

int main()
{
	scanf("%d%d", &n, &k);
	for (int i=1; i<n; i++)
	{
		int p1, p2;
		scanf("%d%d", &p1, &p2);
		graf[p1].push_back(p2);
		graf[p2].push_back(p1);
	}
	dfs(1, 0);
	long long w=0;
	for (int i=0; i<=k; i++)
		dod(w, dp[1][i]);
	printf("%lld\n", w);
	return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

const int MAX_NB_NOEUDS = 100;
const int MOD = 1000 * 1000 * 1000 + 7;

struct Resultat {
	vector<vector<int> > nombre;
	Resultat() {
		nombre = vector<vector<int> >(22, vector<int>(22, 0));
	}
};

int nbNoeuds, maxDist;
vector<int> voisins[MAX_NB_NOEUDS];
vector<Resultat> dyn(MAX_NB_NOEUDS, Resultat());

void calculeDyn(int noeud, int parent) {
	dyn[noeud].nombre[1][0] = 1;
	dyn[noeud].nombre[0][maxDist] = 1;

	for(int voisin : voisins[noeud]) {
		if(voisin != parent) {
			calculeDyn(voisin, noeud);

			Resultat res;
for(int iDB1 = 0;iDB1 <= maxDist;iDB1++) {
	for(int iDB2 = 0;iDB2 <= maxDist;iDB2++) {
		for(int iDN1 = 0;iDN1 <= maxDist;iDN1++) {
			for(int iDN2 = 0;iDN2 <= maxDist;iDN2++) {
				int dB = max(iDN2 >= iDB1 ? 0 : iDB1, iDN1 >= iDB2 ? 0 : iDB2 + 1);
				int dN = max(iDN1, iDN2 - 1);
				res.nombre[dB][dN] = (res.nombre[dB][dN] + (long long)dyn[noeud].nombre[iDB1][iDN1] * dyn[voisin].nombre[iDB2][iDN2]) % MOD;
			}
		}
	}
}

			dyn[noeud] = res;
		}
	}
}

int main() {
	cin >> nbNoeuds >> maxDist;

	for(int iArc = 0;iArc < nbNoeuds - 1;iArc++) {
		int debut, fin;
		cin >> debut >> fin;
		voisins[debut - 1].push_back(fin - 1);
		voisins[fin - 1].push_back(debut - 1);
	}

	calculeDyn(0, -1);

	int somme = 0;
	for(int iDist = 0;iDist <= maxDist;iDist++) {
		somme = (somme + dyn[0].nombre[0][iDist]) % MOD;
	}

	cout << somme << endl;
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>

using namespace std;
typedef long long ll;
typedef pair<int,int> Pi;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) x.begin(), x.end()

const int MOD = 1e9 + 7;
ll D[110][42][22];
int n, k;
vector <int> E[110];

void dfs(int x, int fa){
	ll temp[42][22] = {}, temp2[42][22] = {};
	int s = -1;
	for(auto e : E[x])if(e != fa){
		dfs(e, x);
		if(s == -1){
			for(int i=0;i<=k+k;i++)for(int j=0;j<=k;j++)temp[i][j] = D[e][i][j];
			s = 0;
		}
		else{
			for(int i=0;i<=k+k;i++)for(int j=0;j<=k;j++){
				for(int u=0;u<=k+k;u++){
					for(int v=0;v<=k;v++){
						int q = max(j, v);
						if(q + min(i, u) + 1 <= k)q = 0;
						temp2[min(i, u)][q] = (temp[i][j] * D[e][u][v] + temp2[min(i, u)][q]) % MOD;
					}
				}
			}
			for(int i=0;i<=k+k;i++)for(int j=0;j<=k;j++)temp[i][j] = temp2[i][j], temp2[i][j] = 0;
		}
	}
	if(s == -1){
		D[x][0][0] = 1;
		D[x][k+1][1] = 1;
		return;
	}
	for(int i=0;i<=k+k;i++){
		for(int j=0;j<=k;j++){
			int nj = j+1;
			if(j == 0){
				if(i >= k)nj = 1;
				else nj = 0;
			}
			D[x][i+1][nj] = (D[x][i+1][nj] + temp[i][j]) % MOD;
			D[x][0][0] = (D[x][0][0] + temp[i][j]) % MOD;
		}
	}
}

void solve(){
	scanf("%d%d", &n, &k);
	rep(i, n-1){
		int x, y; scanf("%d%d", &x, &y);
		E[x].pb(y);
		E[y].pb(x);
	}
	dfs(1, -1);
	ll ans = 0;
	for(int i=0;i<=k;i++)ans = (ans + D[1][i][0]) % MOD;
	printf("%lld", ans);
}

int main(){
	int Tc = 1; //scanf("%d\n", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		solve();
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>

using namespace std;
typedef long long ll;
typedef pair<int,int> Pi;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) x.begin(), x.end()

const int MOD = 1e9 + 7;
ll D[110][42][22];
int n, k;
vector <int> E[110];

void dfs(int x, int fa){
	ll temp[42][22] = {}, temp2[42][22] = {};
	int s = -1;
	for(auto e : E[x])if(e != fa){
		dfs(e, x);
		if(s == -1){
			for(int i=0;i<=k+k;i++)for(int j=0;j<=k;j++)temp[i][j] = D[e][i][j];
			s = 0;
		}
		else{
			for(int i=0;i<=k+k;i++)for(int j=0;j<=k;j++){
				for(int u=0;u<=k+k;u++){
					for(int v=0;v<=k;v++){
						int q = max(j, v);
						if(q + min(i, u) + 1 <= k)q = 0;
						temp2[min(i, u)][q] = (temp[i][j] * D[e][u][v] + temp2[min(i, u)][q]) % MOD;
					}
				}
			}
			for(int i=0;i<=k+k;i++)for(int j=0;j<=k;j++)temp[i][j] = temp2[i][j], temp2[i][j] = 0;
		}
	}
	if(s == -1){
		D[x][0][0] = 1;
		D[x][k+1][1] = 1;
		return;
	}
	for(int i=0;i<=k+k;i++){
		for(int j=0;j<=k;j++){
			int nj = j+1;
			if(j == 0){
				if(i > k)nj = 1;
				else nj = 0;
			}
			D[x][i+1][nj] = (D[x][i+1][nj] + temp[i][j]) % MOD;
			D[x][0][0] = (D[x][0][0] + temp[i][j]) % MOD;
		}
	}
}

void solve(){
	scanf("%d%d", &n, &k);
	rep(i, n-1){
		int x, y; scanf("%d%d", &x, &y);
		E[x].pb(y);
		E[y].pb(x);
	}
	dfs(1, -1);
	ll ans = 0;
	for(int i=0;i<=k;i++)ans = (ans + D[1][i][0]) % MOD;
	printf("%lld", ans);
}

int main(){
	int Tc = 1; //scanf("%d\n", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		solve();
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < (int) n; ++i)
#define ford(i, n) for (int i = ((int) n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;

#define FILE_NAME "a"

const int MAXN = 100 + 10;
const int MAXK = 20 + 3;
const int MOD = 1e9 + 7;

void add(int& x, int y) {
	((x += y) >= MOD) && (x -= MOD);
}

int mul(int x, int y) {
	return x * 1ll * y % MOD;
}

int n, k;
vi g[MAXN];

bool read() {
	if  (scanf("%d%d", &n, &k) < 2) {
		return 0;
	}
	forn(i, n) {
		g[i].clear();
	}
	forn(i, n - 1) {
		int a, b;
		scanf("%d%d", &a, &b);
		--a;
		--b;
		g[a].pb(b);
		g[b].pb(a);
	}
	return 1;
}

int dp[MAXN][MAXK+1][MAXK+1];
int ndp[MAXK+1][MAXK+1];

void dfs(int v, int p) {
	for (int to : g[v]) {
		if  (to != p) {
			dfs(to, v);
		}
	}

	memset (dp[v], 0, sizeof dp[v]);
	dp[v][0][MAXK] = 1;
	dp[v][MAXK][0] = 1;
	for (int to : g[v]) {
		if  (to == p) {
			continue;
		}
		memset (ndp, 0, sizeof ndp);
		forn(d_w, MAXK + 1) forn(d_b, MAXK + 1) {
			int cur = dp[v][d_w][d_b];
			if  (!cur) {
				continue;
			}
			forn(c_d_w, MAXK + 1) forn(c_d_b, MAXK + 1) {
				int dp_to = dp[to][c_d_w][c_d_b];
				if  (!dp_to) {
					continue;
				}
				if  (c_d_w != MAXK && c_d_w + 1 > k) {
					continue;
				}
				int n_d_b = min(d_b, c_d_b + 1);
				int n_d_w = -1;
				if  (d_w + 1 + c_d_b > k && d_w < MAXK) {
					n_d_w = max(n_d_w, d_w);
				}
				if  (c_d_w + 1 + d_b > k && c_d_w < MAXK) {
					n_d_w = max(n_d_w, c_d_w + 1);
				}
				if  (n_d_w > k) {
					continue;
				}
				if  (n_d_w == -1) {
					n_d_w = MAXK;
				}
				add(ndp[n_d_w][n_d_b], mul(dp_to, cur));
			}
		}
		memcpy(dp[v], ndp, sizeof ndp);
	}

	// forn(d_w, MAXK+1) forn(d_b, MAXK+1) {
	// 	int c = dp[v][d_w][d_b];
	// 	if  (c) {
	// 		printf("dp[v=%d][d_w=%d][d_b=%d] = %d\n", v, d_w, d_b, c);
	// 	}
	// }
}

int solve() {
	dfs(0, -1);

	int ans = 0;
	forn(d_b, MAXK+1) {
		add(ans, dp[0][MAXK][d_b]);
	}
	return ans;
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		printf("%d\n", solve());
	}

#ifdef LOCAL
	cerr.precision(5);
	cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < (int) n; ++i)
#define ford(i, n) for (int i = ((int) n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;

#define FILE_NAME "a"

const int MAXN = 100 + 10;
const int MAXK = 20 + 2;
const int MOD = 1e9 + 7;

void add(int& x, int y) {
	((x += y) >= MOD) && (x -= MOD);
}

int mul(int x, int y) {
	return x * 1ll * y % MOD;
}

int n, k;
vi g[MAXN];

bool read() {
	if  (scanf("%d%d", &n, &k) < 2) {
		return 0;
	}
	forn(i, n) {
		g[i].clear();
	}
	forn(i, n - 1) {
		int a, b;
		scanf("%d%d", &a, &b);
		--a;
		--b;
		g[a].pb(b);
		g[b].pb(a);
	}
	return 1;
}

int dp[MAXN][MAXK+1][MAXK+1];
int ndp[MAXK+1][MAXK+1];

void dfs(int v, int p) {
	for (int to : g[v]) {
		if  (to != p) {
			dfs(to, v);
		}
	}

	memset (dp[v], 0, sizeof dp[v]);
	dp[v][0][MAXK] = 1;
	for (int to : g[v]) {
		if  (to == p) {
			continue;
		}
		memset (ndp, 0, sizeof ndp);
		forn(d_w, MAXK + 1) forn(d_b, MAXK + 1) {
			int cur = dp[v][d_w][d_b];
			if  (!cur) {
				continue;
			}
			forn(c_d_w, MAXK + 1) forn(c_d_b, MAXK + 1) {
				int dp_to = dp[to][c_d_w][c_d_b];
				if  (!dp_to) {
					continue;
				}
				int n_d_b = min(d_b, c_d_b + 1);
				int n_d_w = -1;
				if  (d_w + 1 + c_d_b > k && d_w < MAXK) {
					n_d_w = max(n_d_w, d_w);
				}
				if  (c_d_w + 1 + d_b > k && c_d_w < MAXK) {
					n_d_w = max(n_d_w, c_d_w + 1);
				}
				if  (n_d_w == -1) {
					n_d_w = MAXK;
				}
				add(ndp[n_d_w][n_d_b], mul(dp_to, cur));
			}
		}
		memcpy(dp[v], ndp, sizeof ndp);
	}

	int aux = 0;
	forn(d_w, MAXK + 1) {
		forn(d_b, MAXK + 1) {
			if  (d_w <= k || d_w == MAXK) {
				add(aux, dp[v][d_w][d_b]);
			}
		}
	}
	add(dp[v][MAXK][0], aux);

	// forn(d_w, MAXK+1) forn(d_b, MAXK+1) {
	// 	int c = dp[v][d_w][d_b];
	// 	if  (c) {
	// 		printf("dp[v=%d][d_w=%d][d_b=%d] = %d\n", v, d_w, d_b, c);
	// 	}
	// }
}

int solve() {
	dfs(0, -1);

	int ans = 0;
	forn(d_b, MAXK+1) {
		add(ans, dp[0][MAXK][d_b]);
	}
	return ans;
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		printf("%d\n", solve());
	}

#ifdef LOCAL
	cerr.precision(5);
	cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <string.h>
#include <string>

using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
#define Rep(i,n) for(int i = 1; i <= n; ++i)
#define lowbit(x) ((x)&(-x))
//#pragma comment(linker,"/STACK:1024000000,1024000000")
#define eps 1e-8
#define sqr(x) ((x)*(x))
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
template<class T>inline void rread(T&num){
    num=0;T f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
    num*=f;
}
const ll inf = 1e18;
const int maxn = 2e3 +10, mod = 1e9 + 7;
ll gcd (ll a, ll b)
{return ( a ? gcd(b%a, a) : b );}
void exgcd(ll a,ll b,ll &d,ll& x,ll& y)
{
    if(!b){d=a;x=1;y=0;}
    else {exgcd(b,a%b,d,y,x);y-=x*(a/b);}
}
ll power(ll a, ll n)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}
//head

int n,k;
vector<int>nex[maxn],son;
ll dp[maxn][50],sum[maxn][50],gp[maxn][1],ss[maxn][50];
void dfs(int x,int be)
{
    for(int i=0;i<nex[x].size();i++)
        if(nex[x][i]!=be)
    {
        dfs(nex[x][i],x);
    }
    son.clear();
    for(int i=0;i<nex[x].size();i++)
        if(nex[x][i]!=be)
        son.pb(nex[x][i]);
    if(son.size()==0)
    {
        dp[x][19]=1;
        dp[x][k+20]=1;return ;
    }
        ll gg=0;
    for(int j=19;j>=20-k;j--){
        gp[0][0]=0;gp[0][1]=dp[son[0]][j+1];
        for(int s=j+2;s<=40-j-1;s++)
        gp[0][0]=(gp[0][0]+dp[son[0]][s])%mod;
        for(int i=1;i<son.size();i++)
    {
        gg=0;
        for(int s=j+2;s<=40-j-1;s++)
        gg=(gg+dp[son[i]][s])%mod;
        gp[i][1]=(gp[i-1][1]*((gg+dp[son[i]][j+1])%mod)%mod+gp[i-1][0]*dp[son[i]][j+1]%mod)%mod;
        gp[i][0]=(gp[i-1][0]*gg%mod);
    }
        dp[x][j]=gp[son.size()-1][1];
    }
    for(int j=20;j<k+20;j++)
    {
        gp[0][0]=0;gp[0][1]=dp[son[0]][j+1];
        for(int s=40-j-1;s<=j-2;s++)
        gp[0][0]=(gp[0][0]+dp[son[0]][s])%mod;
        for(int i=1;i<son.size();i++)
        {
            gg=0;
        for(int s=40-j-1;s<=j-2;s++)
        gg=(gg+dp[son[i]][s])%mod;
        gp[i][1]=(gp[i-1][1]*((gg+dp[son[i]][j+1])%mod)%mod+gp[i-1][0]*dp[son[i]][j+1]%mod)%mod;
        gp[i][0]=(gp[i-1][0]*gg%mod);
        }
        dp[x][j]=gp[son.size()-1][1];
    }
    dp[x][k+20]=1;
    for(int i=0;i<son.size();i++)
    {
        gg=0;
        for(int j=20-k;j<=20+k;j++)
            gg=(gg+dp[son[i]][j])%mod;
        dp[x][k+20]=(dp[x][k+20]*gg)%mod;
    }
}
int main()
{
    int kase=1;
    while(cin>>n>>k)
    {
        for(int i=1;i<=n;i++)nex[i].clear();memset(dp,0,sizeof dp);
        for(int i=1;i<n;i++)
        {
            int u,v;scanf("%d%d",&u,&v);
            nex[u].pb(v);nex[v].pb(u);
        }
        dfs(1,0);
        ll ans=0;

        for(int i=20;i<=20+k;i++)
            ans=(ans+dp[1][i])%mod;
        printf("%lld\n",ans);

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <string.h>
#include <string>

using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
#define Rep(i,n) for(int i = 1; i <= n; ++i)
#define lowbit(x) ((x)&(-x))
//#pragma comment(linker,"/STACK:1024000000,1024000000")
#define eps 1e-8
#define sqr(x) ((x)*(x))
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
template<class T>inline void rread(T&num){
    num=0;T f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
    num*=f;
}
const ll inf = 1e18;
const int maxn = 2e3 +10, mod = 1e9 + 7;
ll gcd (ll a, ll b)
{return ( a ? gcd(b%a, a) : b );}
void exgcd(ll a,ll b,ll &d,ll& x,ll& y)
{
    if(!b){d=a;x=1;y=0;}
    else {exgcd(b,a%b,d,y,x);y-=x*(a/b);}
}
ll power(ll a, ll n)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}
//head

int n,k;
vector<int>nex[maxn],son;
ll dp[maxn][50],sum[maxn][50],gp[maxn][1],ss[maxn][50];
void dfs(int x,int be)
{
    for(int i=0;i<nex[x].size();i++)
        if(nex[x][i]!=be)
    {
        dfs(nex[x][i],x);
    }
    son.clear();
    for(int i=0;i<nex[x].size();i++)
        if(nex[x][i]!=be)
        son.pb(nex[x][i]);
    if(son.size()==0)
    {
        dp[x][19]=1;
        dp[x][k+20]=1;return ;
    }
        ll gg=0;
    for(int j=19;j>=20-k;j--){
        gp[0][0]=0;gp[0][1]=dp[son[0]][j+1];
        for(int s=j+2;s<=40-j-1;s++)
        gp[0][0]=(gp[0][0]+dp[son[0]][s])%mod;
        for(int i=1;i<son.size();i++)
    {
        gg=0;
        for(int s=j+2;s<=40-j-1;s++)
        gg=(gg+dp[son[i]][s])%mod;
        gp[i][1]=(gp[i-1][1]*((gg+dp[son[i]][j+1])%mod)%mod+gp[i-1][0]*dp[son[i]][j+1]%mod)%mod;
        gp[i][0]=(gp[i-1][0]*gg%mod);
    }
        dp[x][j]=gp[son.size()-1][1];
    }
    for(int j=20;j<k+20;j++)
    {
        gp[0][0]=0;gp[0][1]=dp[son[0]][j+1];
        for(int s=40-j-1;s<=j-1;s++)
        gp[0][0]=(gp[0][0]+dp[son[0]][s])%mod;
        for(int i=1;i<son.size();i++)
        {
            gg=0;
        for(int s=40-j-1;s<=j-1;s++)
        gg=(gg+dp[son[i]][s])%mod;
        gp[i][1]=(gp[i-1][1]*((gg+dp[son[i]][j+1])%mod)%mod+gp[i-1][0]*dp[son[i]][j+1]%mod)%mod;
        gp[i][0]=(gp[i-1][0]*gg%mod);
        }
        dp[x][j]=gp[son.size()-1][1];
    }
    dp[x][k+20]=1;
    for(int i=0;i<son.size();i++)
    {
        gg=0;
        for(int j=20-k;j<=20+k;j++)
            gg=(gg+dp[son[i]][j])%mod;
        dp[x][k+20]=(dp[x][k+20]*gg)%mod;
    }
}
int main()
{
    int kase=1;
    while(cin>>n>>k)
    {
        for(int i=1;i<=n;i++)nex[i].clear();memset(dp,0,sizeof dp);
        for(int i=1;i<n;i++)
        {
            int u,v;scanf("%d%d",&u,&v);
            nex[u].pb(v);nex[v].pb(u);
        }
        dfs(1,0);
        ll ans=0;

        for(int i=20;i<=20+k;i++)
            ans=(ans+dp[1][i])%mod;
        printf("%lld\n",ans);

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <string.h>
#include <string>

using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
#define Rep(i,n) for(int i = 1; i <= n; ++i)
#define lowbit(x) ((x)&(-x))
//#pragma comment(linker,"/STACK:1024000000,1024000000")
#define eps 1e-8
#define sqr(x) ((x)*(x))
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
template<class T>inline void rread(T&num){
    num=0;T f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
    num*=f;
}
const ll inf = 1e18;
const int maxn = 2e3 +10, mod = 1e9 + 7;
ll gcd (ll a, ll b)
{return ( a ? gcd(b%a, a) : b );}
void exgcd(ll a,ll b,ll &d,ll& x,ll& y)
{
    if(!b){d=a;x=1;y=0;}
    else {exgcd(b,a%b,d,y,x);y-=x*(a/b);}
}
ll power(ll a, ll n)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}
//head

int n,k;
vector<int>nex[maxn],son;
ll dp[maxn][50],sum[maxn][50],gp[maxn][1],ss[maxn][50];
void dfs(int x,int be)
{
    for(int i=0;i<nex[x].size();i++)
        if(nex[x][i]!=be)
    {
        dfs(nex[x][i],x);
    }
    son.clear();
    for(int i=0;i<nex[x].size();i++)
        if(nex[x][i]!=be)
        son.pb(nex[x][i]);
    if(son.size()==0)
    {
        dp[x][19]=1;
        dp[x][k+20]=1;return ;
    }
        ll gg=0;
    for(int j=19;j>=20-k;j--){
        gp[0][0]=0;gp[0][1]=dp[son[0]][j+1];
        for(int s=j+2;s<=40-j-1;s++)
        gp[0][0]=(gp[0][0]+dp[son[0]][s])%mod;
        for(int i=1;i<son.size();i++)
    {
        gg=0;
        for(int s=j+2;s<=40-j-1;s++)
        gg=(gg+dp[son[i]][s])%mod;
        gp[i][1]=(gp[i-1][1]*((gg+dp[son[i]][j+1])%mod)%mod+gp[i-1][0]*dp[son[i]][j+1]%mod)%mod;
        gp[i][0]=(gp[i-1][0]*gg%mod);
    }
        dp[x][j]=gp[son.size()-1][1];
    }
    for(int j=20;j<k+20;j++)
    {
        gp[0][0]=0;gp[0][1]=dp[son[0]][j+1];
        for(int s=40-j;s<=j;s++)
        gp[0][0]=(gp[0][0]+dp[son[0]][s])%mod;
        for(int i=1;i<son.size();i++)
        {
            gg=0;
        for(int s=40-j;s<=j;s++)
        gg=(gg+dp[son[i]][s])%mod;
        gp[i][1]=(gp[i-1][1]*((gg+dp[son[i]][j+1])%mod)%mod+gp[i-1][0]*dp[son[i]][j+1]%mod)%mod;
        gp[i][0]=(gp[i-1][0]*gg%mod);
        }
        dp[x][j]=gp[son.size()-1][1];
    }
    dp[x][k+20]=1;
    for(int i=0;i<son.size();i++)
    {
        gg=0;
        for(int j=20-k;j<=20+k;j++)
            gg=(gg+dp[son[i]][j])%mod;
        dp[x][k+20]=(dp[x][k+20]*gg)%mod;
    }
}
int main()
{
    int kase=1;
    while(cin>>n>>k)
    {
        for(int i=1;i<=n;i++)nex[i].clear();memset(dp,0,sizeof dp);
        for(int i=1;i<n;i++)
        {
            int u,v;scanf("%d%d",&u,&v);
            nex[u].pb(v);nex[v].pb(u);
        }
        dfs(1,0);
        ll ans=0;

        for(int i=20;i<=20+k;i++)
            ans=(ans+dp[1][i])%mod;
        printf("%lld\n",ans);

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int iN = 10100;
const LL P = 1000000007LL;
inline LL Max(const LL &a, const LL &b) {
	return a > b ? a : b;
}
inline LL Min(const LL &a, const LL &b) {
	return a < b ? a : b;
}
inline char get(void) {
	static char buf[100000], *p1 = buf, *p2 = buf;
	if (p1 == p2) {
		p2 = (p1 = buf) + fread(buf, 1, 100000, stdin);
		if (p1 == p2) return EOF;
	}
	return *p1++;
}
inline void read(LL &x) {
	x = 0; static char c;
	for (; !(c >= '0' && c <= '9'); c = get());
	for (; c >= '0' && c <= '9'; x = x * 10 + c - '0', c = get());
}
LL N, K, t[50], f[iN][50];
vector<int> G[iN];
inline void Dfs(int u, int fa) {
	f[u][0] = f[u][K + 1] = 1;
	for (int i = 0, v; i < G[u].size(); i++) {
		if ((v = G[u][i]) == fa) continue;
		Dfs(v, u);
		for (int i = 0; i <= 2 * K; i++) t[i] = 0;
		for (int i = 0; i <= 2 * K; i++)
			for (int j = 0; j <= 2 * K; j++) {
				if (i + j <= 2 * K) (t[Min(i, j + 1)] += f[u][i] * f[v][j]) %= P;
				else (t[Max(i, j + 1)] += f[u][i] * f[v][j]) %= P;
		}
		for (int i = 0; i <= 2 * K; i++) f[u][i] = t[i];
	}
}
int main(void) {
	//freopen("in.txt", "r", stdin);
	read(N), read(K);
	for (LL i = 1, x, y; i < N; i++) {
		read(x), read(y);
		G[x].push_back(y);
		G[y].push_back(x);
	}
	Dfs(1, 0);
	LL Ans = 0;
	for (int i = 0; i <= K; i++) (Ans += f[1][i]) %= P;
	printf("%I64d\n", Ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define mp  make_pair
#define pb  push_back
#define ll  long long
#define vi  vector<ll >
#define vvi vector<vi >
#define all(x) x.begin(), x.end()

ll  mod = (ll)1e9 + 7;
int n, k;
vvi g;
vi  u;
vector<vvi > dp;

void add(int to, int v) {
    int new_b, new_w;
    vvi d(k + 1, vi(k + 1, 0));
    for (int b = 0; b < k + 1; ++b) {
        for (int w = 0; w < k + 1; ++w) {
            for (int bb = 0; bb < k + 1; ++bb) {
                for (int ww = 0; ww < k + 1; ++ww) {
                    if (b == 0) {
                        new_b = 0;
                        new_w = k;
                    }
                    else {
                        if (ww == k)
                            new_w = w;
                        else if (ww == k - 1)
                            continue;
                        else if (w == k)
                            new_w = ww + 1;
                        else
                            new_w = max(w, ww + 1);

                        if (b == k && bb == k)
                            new_b = k;
                        else {
                            new_b = min(b, bb + 1);
                            if (new_w + new_b <= k)
                                new_w = k;
                        }
                    }
                    d[new_b][new_w] += dp[v][b][w] * dp[to][bb][ww];
                    d[new_b][new_w] %= mod;
                }
            }
        }
    }
    dp[v] = d;
}

void dfs(int v) {
    u[v] = 1;
    dp[v][0][k] = dp[v][k][0] = 1;
    for (int i = 0; i < g[v].size(); ++i) {
        int to = g[v][i];
        if (u[to] == 0) {
            dfs(to);
            add(to, v);
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> k;
    g.resize(n);
    for (int i = 0; i < n - 1; ++i) {
        int a, b; cin >> a >> b; --a; --b;
        g[a].pb(b); g[b].pb(a);
    }
    dp.assign(n, vvi(k + 1, vi(k + 1, 0)));
    u.assign(n, 0);
    dfs(0);
    ll res = 0;
    for (int b = 0; b < k + 1; ++b)
        res += dp[0][b][k];
    cout << res % mod << endl;

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;

typedef long long LL;
#define pb push_back
#define mp make_pair
typedef pair<int, int> PII;

const LL mod = 1e9+7;
const int N = 110;

LL dp[N][30][30];

vector<int>G[N];
int k;

LL mult(LL x, LL y){
	return ((x%mod)*(y%mod))%mod;
}

LL add(LL x, LL y){
	return (x+y)%mod;
}

void f(int x, int fr){
	dp[x][0][0] = 1;
	dp[x][1][k+1] = 1;
	for(int y : G[x]){
		if(y==fr) continue;
		f(y, x);
		LL tmp[30][30] = {};
		for(int i = 0; i < 25; ++i){ // x black
			for(int j = 0; j < 25; ++j){ // x white
				for(int ii = 0; ii < 25; ++ii){ // y black
					for(int jj = 0; jj < 25; ++jj) { // y white
						int bl, wh;
						wh = max(j, jj+1);
						bl = min(i, ii+1);
						// if(bl + wh > k+1)continue;
						if(bl + wh <= k+1){
							tmp[0][bl] = add(tmp[0][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
						else{
							tmp[wh][bl] = add(tmp[wh][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
					}
				}
			}
		}
		for(int i = 0; i < 30; ++i) for(int j = 0; j < 30; ++j) dp[x][i][j] = tmp[i][j];
	}
	// cout << x <<endl;
	// for(int i = 0; i < 5; ++i){
	// 	for(int j = 0; j < 5; ++j)  cout << dp[x][i][j]<< ' ';cout <<endl;
	// }
}

int main () {
	int n;
	cin >> n >>k;
	for(int i = 0; i < n-1; ++i){
		int x, y;
		scanf("%d%d", &x, &y);
		--x; --y;
		G[x].pb(y); G[y].pb(x);
	}
	memset(dp, 0, sizeof(dp));
	f(0,0);
	// for(int i = 0; i < 5; ++i){
	// 	for(int j = 0; j < 5; ++j) cout << dp[1][i][j] << ' '; cout <<endl;
	// }
	LL ans = 0;
	for(int i = 0; i <= k; ++i) ans = add(ans, dp[0][0][i]);
	printf("%lld\n", ans);
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;

typedef int LL;
#define pb push_back
#define mp make_pair
typedef pair<int, int> PII;

const LL mod = 1e9+7;
const int N = 110;

LL dp[N][30][30];

vector<int>G[N];
int k;

LL mult(LL x, LL y){
	return ((x%mod)*(y%mod))%mod;
}

LL add(LL x, LL y){
	return (x+y)%mod;
}

void f(int x, int fr){
	dp[x][0][0] = 1;
	dp[x][1][k+1] = 1;
	for(int y : G[x]){
		if(y==fr) continue;
		f(y, x);
		LL tmp[30][30] = {};
		for(int i = 0; i < k+2; ++i){ // x black
			for(int j = 0; j < k+2; ++j){ // x white
				for(int ii = 0; ii < k+2; ++ii){ // y black
					for(int jj = 0; jj < k+2; ++jj) { // y white
						int bl, wh;
						wh = max(j, jj+1);
						bl = min(i, ii+1);
						// if(bl + wh > k+1)continue;
						if(bl + wh <= k+1){
							tmp[0][bl] = add(tmp[0][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
						else{
							tmp[wh][bl] = add(tmp[wh][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
					}
				}
			}
		}
		for(int i = 0; i < 30; ++i) for(int j = 0; j < 30; ++j) dp[x][i][j] = tmp[i][j];
	}
	// cout << x <<endl;
	// for(int i = 0; i < 5; ++i){
	// 	for(int j = 0; j < 5; ++j)  cout << dp[x][i][j]<< ' ';cout <<endl;
	// }
}

int main () {
	int n;
	cin >> n >>k;
	for(int i = 0; i < n-1; ++i){
		int x, y;
		scanf("%d%d", &x, &y);
		--x; --y;
		G[x].pb(y); G[y].pb(x);
	}
	memset(dp, 0, sizeof(dp));
	f(0,0);
	// for(int i = 0; i < 5; ++i){
	// 	for(int j = 0; j < 5; ++j) cout << dp[1][i][j] << ' '; cout <<endl;
	// }
	LL ans = 0;
	for(int i = 0; i <= k; ++i) ans = add(ans, dp[0][0][i]);
	printf("%d\n", ans);
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;

typedef long long LL;
#define pb push_back
#define mp make_pair
typedef pair<int, int> PII;

const LL mod = 1e9+7;
const int N = 110;

LL dp[N][30][30];

vector<int>G[N];
int k;

LL mult(LL x, LL y){
	return ((x%mod)*(y%mod))%mod;
}

LL add(LL x, LL y){
	return (x+y)%mod;
}

void f(int x, int fr){
	dp[x][0][0] = 1;
	dp[x][1][k+1] = 1;
	for(int y : G[x]){
		if(y==fr) continue;
		f(y, x);
		LL tmp[30][30] = {};
		for(int i = 0; i < k+2; ++i){ // x black
			for(int j = 0; j < k+2; ++j){ // x white
				for(int ii = 0; ii < k+2; ++ii){ // y black
					for(int jj = 0; jj < k+2; ++jj) { // y white
						int bl, wh;
						wh = max(j, jj+1);
						bl = min(i, ii+1);
						// if(bl + wh > k+1)continue;
						if(bl + wh <= k+1){
							tmp[0][bl] = add(tmp[0][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
						else{
							tmp[wh][bl] = add(tmp[wh][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
					}
				}
			}
		}
		for(int i = 0; i < 30; ++i) for(int j = 0; j < 30; ++j) dp[x][i][j] = tmp[i][j];
	}
	// cout << x <<endl;
	// for(int i = 0; i < 5; ++i){
	// 	for(int j = 0; j < 5; ++j)  cout << dp[x][i][j]<< ' ';cout <<endl;
	// }
}

int main () {
	int n;
	cin >> n >>k;
	for(int i = 0; i < n-1; ++i){
		int x, y;
		scanf("%d%d", &x, &y);
		--x; --y;
		G[x].pb(y); G[y].pb(x);
	}
	memset(dp, 0, sizeof(dp));
	f(0,0);
	// for(int i = 0; i < 5; ++i){
	// 	for(int j = 0; j < 5; ++j) cout << dp[1][i][j] << ' '; cout <<endl;
	// }
	LL ans = 0;
	for(int i = 0; i <= k; ++i) ans = add(ans, dp[0][0][i]);
	printf("%lld\n", ans);
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;

typedef int LL;
#define pb push_back
#define mp make_pair
typedef pair<int, int> PII;

const LL mod = 1e9+7;
const int N = 110;

LL dp[N][30][30];

vector<int>G[N];
int k;

LL mult(long long x, long long y){
	return ((x%mod)*(y%mod))%mod;
}

LL add(LL x, LL y){
	return (x+y)%mod;
}

void f(int x, int fr){
	dp[x][0][0] = 1;
	dp[x][1][k+1] = 1;
	for(int y : G[x]){
		if(y==fr) continue;
		f(y, x);
		LL tmp[30][30] = {};
		for(int i = 0; i < k+2; ++i){ // x black
			for(int j = 0; j < k+2; ++j){ // x white
				for(int ii = 0; ii < k+2; ++ii){ // y black
					for(int jj = 0; jj < k+2; ++jj) { // y white
						int bl, wh;
						wh = max(j, jj+1);
						bl = min(i, ii+1);
						if(bl + wh <= k+1){
							tmp[0][bl] = add(tmp[0][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
						else{
							tmp[wh][bl] = add(tmp[wh][bl], mult(dp[x][j][i], dp[y][jj][ii]));
						}
					}
				}
			}
		}
		for(int i = 0; i < 30; ++i) for(int j = 0; j < 30; ++j) dp[x][i][j] = tmp[i][j];
	}
}

int main () {
	int n;
	cin >> n >>k;
	for(int i = 0; i < n-1; ++i){
		int x, y;
		scanf("%d%d", &x, &y);
		--x; --y;
		G[x].pb(y); G[y].pb(x);
	}
	memset(dp, 0, sizeof(dp));
	f(0,0);
	LL ans = 0;
	for(int i = 0; i <= k; ++i) ans = add(ans, dp[0][0][i]);
	printf("%d\n", ans);
}


#include <algorithm>
#include <iostream>
#include <vector>
#include <array>

using namespace std;
typedef long long int Z;
constexpr Z M = 1000000007;

int n;
vector<vector<int>> G;
int k;
typedef array<array<Z, 22>, 22> A;
vector<A> T;

void dfs(int v = 0, int par = -1) {
	A r{};
	r[0][0] = 1;

	for(int x : G[v]) {
		if(x == par) continue;
		dfs(x, v);
		A r2{};
		const A& a1 = r;
		const A& a2 = T[x];

		for(int b1 = 0; b1 < 22; ++b1) {
		for(int w1 = 0; w1 < 22; ++w1) {
		for(int b2 = 0; b2 < 22; ++b2) {
		for(int w2 = 0; w2 < 22; ++w2) {
			Z count = a1[b1][w1] * a2[b2][w2];
			if(!count) continue;
			count %= M;

			int b;
			if(b1 == 0) {
				b = b2;
			} else if(b2 == 0) {
				b = b1;
			} else {
				b = min(b1, b2);
			}
			int w = max(w1, w2);

			if(b != 0 && b + w <= k) {
				w = 0;
			}

			r2[b][w] += count;
			r2[b][w] %= M;
		}
		}
		}
		}

		r = r2;
	}

	A q{};

	// black
	for(int b = 0; b < 22; ++b) {
		for(int w = 0; w <= k; ++w) {
			q[1][0] += r[b][w];
			q[1][0] %= M;
		}
	}

	// white
	for(int b = 0; b < 22; ++b) {
		for(int w = 0; w < 22; ++w) {
			int nb = b + 1;
			if(b == 0) nb = 0;
			int nw = w + 1;
			if(nw == 1 && b != 0 && b <= k) nw = 0;
			if(nb < 22 && nw < 22) {
				q[nb][nw] += r[b][w];
				q[nb][nw] %= M;
			}
		}
	}

	T[v] = q;
}

int main() {
	cin.sync_with_stdio(false);
	cin.tie(nullptr);

	cin >> n >> k;
	G.resize(n);
	T.resize(n);
	for(int i = 0; i < n - 1; ++i) {
		int a, b;
		cin >> a >> b;
		--a;
		--b;
		G[a].push_back(b);
		G[b].push_back(a);
	}

	dfs();

	Z ret = 0;
	for(int b = 0; b < 22; ++b) {
		ret += T[0][b][0];
		ret %= M;
	}

	cout << ret << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
#include <array>

using namespace std;
typedef long long int Z;
constexpr Z M = 1000000007;

int n;
vector<vector<int>> G;
int k;
typedef array<array<Z, 22>, 22> A;
vector<A> T;

A emp;

void dfs(int v = 0, int par = -1) {
	A r = emp;
	r[0][0] = 1;

	for(int x : G[v]) {
		if(x == par) continue;
		dfs(x, v);
		A r2 = emp;
		const A& a1 = r;
		const A& a2 = T[x];

		for(int b1 = 0; b1 < 22; ++b1) {
		for(int w1 = 0; w1 < 22; ++w1) {
		for(int b2 = 0; b2 < 22; ++b2) {
		for(int w2 = 0; w2 < 22; ++w2) {
			Z count = a1[b1][w1] * a2[b2][w2];
			if(!count) continue;
			count %= M;

			int b;
			if(b1 == 0) {
				b = b2;
			} else if(b2 == 0) {
				b = b1;
			} else {
				b = min(b1, b2);
			}
			int w = max(w1, w2);

			if(b != 0 && b + w <= k) {
				w = 0;
			}

			r2[b][w] += count;
			r2[b][w] %= M;
		}
		}
		}
		}

		r = r2;
	}

	A q = emp;

	// black
	for(int b = 0; b < 22; ++b) {
		for(int w = 0; w <= k; ++w) {
			q[1][0] += r[b][w];
			q[1][0] %= M;
		}
	}

	// white
	for(int b = 0; b < 22; ++b) {
		for(int w = 0; w < 22; ++w) {
			int nb = b + 1;
			if(b == 0) nb = 0;
			int nw = w + 1;
			if(nw == 1 && b != 0 && b <= k) nw = 0;
			if(nb >= 22) nb = 21;
			if(nw < 22) {
				q[nb][nw] += r[b][w];
				q[nb][nw] %= M;
			}
		}
	}

	T[v] = q;
}

int main() {
	for(int i = 0; i < 22; ++i) {
	for(int j = 0; j < 22; ++j) {
		emp[i][j] = 0;
	}
	}

	cin.sync_with_stdio(false);
	cin.tie(nullptr);

	cin >> n >> k;
	G.resize(n);
	T.resize(n);
	for(int i = 0; i < n - 1; ++i) {
		int a, b;
		cin >> a >> b;
		--a;
		--b;
		G[a].push_back(b);
		G[b].push_back(a);
	}

	dfs();

	Z ret = 0;
	for(int b = 0; b < 22; ++b) {
		ret += T[0][b][0];
		ret %= M;
	}

	cout << ret << '\n';

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int mod=1000000007;
inline void add(int &a,int b){
    a+=b;
    if(a>=mod)a-=mod;
}

int N,K;
vint G[111];

int dp[111][21][21];
int tmp[21][21];

void dfs(int v,int p){
    dp[v][0][0]=1;
    dp[v][K][1]=1;

    for(auto u:G[v]){
        if(u==p)continue;
        dfs(u,v);

        memset(tmp,0,sizeof(tmp));
        for(int i=0;i<=K;i++){
            for(int j=0;j<=K;j++){
                for(int k=0;k<=K;k++){
                    for(int l=0;l<=K;l++){
                        int t=0;
                        if(i+l>K)chmax(t,l+1);
                        if(j+k>K)chmax(t,k);
                        if(t>K)continue;
                        int s=min(i,k+1);
                        add(tmp[s][t],dp[v][i][j]*dp[u][k][l]%mod);
                    }
                }
            }
        }
        rep(i,K+1)rep(j,K+1)dp[v][i][j]=tmp[i][j];
    }

}

signed main(){
    cin>>N>>K;
    rep(i,N-1){
        int a,b;
        cin>>a>>b;
        a--;b--;
        G[a].pb(b);G[b].pb(a);
    }
    dfs(0,-1);

    int ans=0;
    rep(i,K+1)add(ans,dp[0][i][0]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int mod=1000000007;
inline void add(int &a,int b){
    a+=b;
    if(a>=mod)a-=mod;
}

int N,K;
vint G[111];

int dp[111][21][21];
int tmp[21][21];

void dfs(int v,int p){
    dp[v][0][0]=1;
    dp[v][K][1]=1;

    for(auto u:G[v]){
        if(u==p)continue;
        dfs(u,v);

        memset(tmp,0,sizeof(tmp));
        for(int i=0;i<=K;i++){
            for(int j=0;j<=K;j++){
                for(int k=0;k<=K;k++){
                    for(int l=0;l<=K;l++){
                        int t=0;
                        if(i+l>K)chmax(t,l+1);
                        if(j+k>K)chmax(t,j);
                        if(t>K)continue;
                        int s=min(i,k+1);
                        add(tmp[s][t],dp[v][i][j]*dp[u][k][l]%mod);
                    }
                }
            }
        }
        rep(i,K+1)rep(j,K+1)dp[v][i][j]=tmp[i][j];
    }

}

signed main(){
    cin>>N>>K;
    rep(i,N-1){
        int a,b;
        cin>>a>>b;
        a--;b--;
        G[a].pb(b);G[b].pb(a);
    }
    dfs(0,-1);

    int ans=0;
    rep(i,K+1)add(ans,dp[0][i][0]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lf double
#define nn 300005
#define mod 100000007
#define err {cout<<"NO ANSWER!";exit(0);};
const int siz=350;
ll f[105][60];int bas=25;ll g[60];//pos means need , neg means out
vector<ll> v[105];int n,m;
void add(ll &x,ll y)
{
	x=x+y;x%=mod;
}
void dfs(int x,int p)
{
	f[x][bas+1]=1;f[x][bas-m]=1;
	for(int i=0;i<v[x].size();i++)
	{
		int t=v[x][i];
		if(t==p) continue;
		dfs(t,x);
		memset(g,0,sizeof(g));
		for(int j=bas-m;j<=bas+m;j++)
		{
			for(int k=bas-m;k<=bas+m;k++)
			{
				ll ct=f[x][j]*f[t][k]%mod;

				if(!ct) continue;
				int a=j-bas,b=k-bas;
				if(a<=0 and b<=0)
				{
					add(g[min(a,b+1)+bas],ct);
				}
				if(a>0 and b>0)
				{
					add(g[max(a,b+1)+bas],ct);
				}
				if(a<=0 and b>0)
				{
					if(-a>=b) add(g[a+bas],ct);
					else add(g[b+1+bas],ct);
				}
				if(a>0 and b<=0)
				{
					if(a>-b) add(g[a+bas],ct);
					else add(g[b+1+bas],ct);
				}
			}
		}
		memcpy(f[x],g,sizeof(g));
	}
}
int main()
{
	cin>>n>>m;
	for(int i=1;i<n;i++)
	{
		int x,y;cin>>x>>y;
		v[x].push_back(y);v[y].push_back(x);
	}
	dfs(1,0);ll ans=0;
	for(int i=bas-m;i<=bas;i++) add(ans,f[1][i]);
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lf double
#define nn 300005
#define mod 1000000007
#define err {cout<<"NO ANSWER!";exit(0);};
const int siz=350;
ll f[105][60];int bas=25;ll g[60];//pos means need , neg means out
vector<ll> v[105];int n,m;
void add(ll &x,ll y)
{
	x=x+y;x%=mod;
}
void dfs(int x,int p)
{
	f[x][bas+1]=1;f[x][bas-m]=1;
	for(int i=0;i<v[x].size();i++)
	{
		int t=v[x][i];
		if(t==p) continue;
		dfs(t,x);
		memset(g,0,sizeof(g));
		for(int j=bas-m;j<=bas+m;j++)
		{
			for(int k=bas-m;k<=bas+m;k++)
			{
				ll ct=f[x][j]*f[t][k]%mod;

				if(!ct) continue;
				int a=j-bas,b=k-bas;
				if(a<=0 and b<=0)
				{
					add(g[min(a,b+1)+bas],ct);
				}
				if(a>0 and b>0)
				{
					add(g[max(a,b+1)+bas],ct);
				}
				if(a<=0 and b>0)
				{
					if(-a>=b) add(g[a+bas],ct);
					else add(g[b+1+bas],ct);
				}
				if(a>0 and b<=0)
				{
					if(a>-b) add(g[a+bas],ct);
					else add(g[b+1+bas],ct);
				}
			}
		}
		memcpy(f[x],g,sizeof(g));
	}
}
int main()
{
	cin>>n>>m;
	for(int i=1;i<n;i++)
	{
		int x,y;cin>>x>>y;
		v[x].push_back(y);v[y].push_back(x);
	}
	dfs(1,0);ll ans=0;
	for(int i=bas-m;i<=bas;i++) add(ans,f[1][i]);
	cout<<ans;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define next next2
using namespace std;
typedef long long LL;
const int MOD=1000000007;
const int MAXN=210;
int n,k;
int head[MAXN],to[MAXN],next[MAXN],cnt=1;
inline void adde(int f,int t)
{
    cnt++,to[cnt]=t,next[cnt]=head[f],head[f]=cnt;
    cnt++,to[cnt]=f,next[cnt]=head[t],head[t]=cnt;
}
int f[210][22][22],ans;
void DFS(int x,int fa)
{
    int w[22][22];
    for(int p=0;p<=k+1;p++)
        for(int q=0;q<=k+2;q++)
            w[p][q]=0;
    f[x][0][k+2]=1,f[x][k+1][0]=1;
    for(int i=head[x];i;i=next[i])
        if(to[i]!=fa)
        {
            DFS(to[i],x);
            for(int pl=0;pl<=k+1;pl++)
                for(int pr=0;pr<=k+1;pr++)
                    for(int ql=0;ql<=k+2;ql++)
                        for(int qr=0;qr<=k+2;qr++)
                        {
                            int np=k+1,nq=-1;
                            bool l_ok=(ql==k+2||pr+ql<=k-1);
                            bool r_ok=(qr==k+2||pl+qr<=k-1);
                            if(l_ok&&r_ok) nq=k+2;
                            else if(l_ok) nq=min(k+1,qr+1);
                            else if(r_ok) nq=min(k+1,ql);
                            else nq=min(k+1,max(ql,qr+1));
                            np=min(pl,pr+1);
                            w[np][nq]=(w[np][nq]+(LL)f[x][pl][ql]*f[to[i]][pr][qr])%MOD;
                        }
            for(int p=0;p<=k+1;p++)
                for(int q=0;q<=k+2;q++)
                    f[x][p][q]=w[p][q],w[p][q]=0;
        }
}
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=1,x,y;i<n;i++) scanf("%d%d",&x,&y),adde(x,y);
    DFS(1,-1);
    for(int i=0;i<=k;i++)
        ans=(ans+f[1][i][k+2])%MOD;
    printf("%d\n",ans);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define next next2
using namespace std;
typedef long long LL;
const int MOD=1000000007;
const int MAXN=210;
int n,k;
int head[MAXN],to[MAXN],next[MAXN],cnt=1;
inline void adde(int f,int t)
{
    cnt++,to[cnt]=t,next[cnt]=head[f],head[f]=cnt;
    cnt++,to[cnt]=f,next[cnt]=head[t],head[t]=cnt;
}
int f[210][22][23],ans;
void DFS(int x,int fa)
{
    int w[22][23];
    for(int p=0;p<=k+1;p++)
        for(int q=0;q<=k+2;q++)
            w[p][q]=0;
    f[x][0][k+2]=1,f[x][k+1][0]=1;
    for(int i=head[x];i;i=next[i])
        if(to[i]!=fa)
        {
            DFS(to[i],x);
            for(int pl=0;pl<=k+1;pl++)
                for(int pr=0;pr<=k+1;pr++)
                    for(int ql=0;ql<=k+2;ql++)
                        for(int qr=0;qr<=k+2;qr++)
                        {
                            int np=k+1,nq=-1;
                            bool l_ok=(ql==k+2||pr+ql<=k-1);
                            bool r_ok=(qr==k+2||pl+qr<=k-1);
                            if(l_ok&&r_ok) nq=k+2;
                            else if(l_ok) nq=min(k+1,qr+1);
                            else if(r_ok) nq=min(k+1,ql);
                            else nq=min(k+1,max(ql,qr+1));
                            np=min(pl,pr+1);
                            w[np][nq]=(w[np][nq]+(LL)f[x][pl][ql]*f[to[i]][pr][qr])%MOD;
                        }
            for(int p=0;p<=k+1;p++)
                for(int q=0;q<=k+2;q++)
                    f[x][p][q]=w[p][q],w[p][q]=0;
        }
}
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=1,x,y;i<n;i++) scanf("%d%d",&x,&y),adde(x,y);
    DFS(1,-1);
    for(int i=0;i<=k;i++)
        ans=(ans+f[1][i][k+2])%MOD;
    printf("%d\n",ans);
    return 0;
}


#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a);i<=(b);i++)
#define ROF(i,a,b) for(int i = (a);i>=(b);i--)
#define MST(a,x) memset(a,x,sizeof(a))
#define ll long long
#define PB push_back
#define PH push
#define MP make_pair
#define FT first
#define SD second
#define N 105
#define M 100005
#define INF 1000000007
#define MOD 1000000007
#define MOD2 1000000009
#define eps 1e-8
using namespace std;

vector<int>e[N];
ll dp[N][N];
ll f[N];
int n,k;
void dfs(int u,int fa)
{
    MST(dp[u],0);
    dp[u][0] = dp[u][k+1] = 1;
    for(auto v:e[u])
    {
        if(v == fa)continue;
        dfs(v,u);
        MST(f,0);

        for(int i = 0;i<=2*k;i++)
        {
            for(int j = 0;j<=2*k;j++)
            {
                if(i+j+1<=2*k+1)f[min(i,j+1)] = (f[min(i,j+1)]+dp[u][i]*dp[v][j]%MOD)%MOD;
                else f[max(i,j+1)] = (f[max(i,j+1)]+dp[u][i]*dp[v][j]%MOD)%MOD;
            }
        }
        for(int i = 0;i<=2*k;i++)dp[u][i] = f[i];
    }
}
int main()
{
    while(cin>>n>>k)
    {
        FOR(i,1,n)e[i].clear();
        FOR(i,1,n-1)
        {
            int x,y;
            cin>>x>>y;
            e[x].PB(y);
            e[y].PB(x);
        }
        dfs(1,-1);
        ll ans = 0;
        FOR(i,0,k)
        {
            ans = (ans+dp[1][i])%MOD;
            //cout<<i<<" "<<dp[1][i]<<endl;
        }
        cout<<ans<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a);i<=(b);i++)
#define ROF(i,a,b) for(int i = (a);i>=(b);i--)
#define MST(a,x) memset(a,x,sizeof(a))
#define ll long long
#define PB push_back
#define PH push
#define MP make_pair
#define FT first
#define SD second
#define N 105
#define M 100005
#define INF 1000000007
#define MOD 1000000007
#define MOD2 1000000009
#define eps 1e-8
using namespace std;

vector<int>e[N];
ll dp[N][30][30];
ll f[30][30];
int n,k;
void dfs(int u,int fa)
{
    MST(dp[u],0);
    dp[u][1][0] = dp[u][k+2][1] = 1;
    for(auto v:e[u])
    {
        if(v == fa)continue;
        dfs(v,u);

        MST(f,0);
        for(int i = 0;i<=k+1;i++)
        {
            for(int j = -1;j<k;j++)
            {
                for(int ii = 0;ii<=k+1;ii++)
                {
                    for(int jj = -1;jj<k;jj++)
                    {
                        int new_i = min(i,ii+1);

                        int new_j1 = jj == -1?-1:(k-i>=jj+1?-1:jj+1);
                        int new_j2 = j == -1?-1:(k-ii-1>=j?-1:j);
                        int new_j = max(new_j1,new_j2);

                        f[new_i+1][new_j+1] = (f[new_i+1][new_j+1]+dp[u][i+1][j+1]*dp[v][ii+1][jj+1]%MOD)%MOD;
                    }
                }
            }
        }
        for(int i = 0;i<=k+1;i++)
        {
            for(int j = -1;j<k;j++)
            {
                dp[u][i+1][j+1] = f[i+1][j+1];
            }
        }
    }
}
int main()
{
    while(cin>>n>>k)
    {
        FOR(i,1,n)e[i].clear();
        FOR(i,1,n-1)
        {
            int x,y;
            cin>>x>>y;
            e[x].PB(y);
            e[y].PB(x);
        }
        dfs(1,-1);
        ll ans = 0;
        for(int i = 0;i<=k;i++)
        {
            for(int j = -1;j<k;j++)
            {
                //cout<<i<<" "<<j<<" "<<dp[1][i+1][j+1]<<endl;
                if(i+j>k)break;
                ans = (ans+dp[1][i+1][j+1])%MOD;
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a);i<=(b);i++)
#define ROF(i,a,b) for(int i = (a);i>=(b);i--)
#define MST(a,x) memset(a,x,sizeof(a))
#define ll long long
#define PB push_back
#define PH push
#define MP make_pair
#define FT first
#define SD second
#define N 105
#define M 100005
#define INF 1000000007
#define MOD 1000000007
#define MOD2 1000000009
#define eps 1e-8
using namespace std;

vector<int>e[N];
ll dp[N][30][30];
ll f[30][30];
int n,k;
void dfs(int u,int fa)
{
    MST(dp[u],0);
    dp[u][1][0] = dp[u][k+2][1] = 1;
    for(auto v:e[u])
    {
        if(v == fa)continue;
        dfs(v,u);

        MST(f,0);
        for(int i = 0;i<=k+1;i++)
        {
            for(int j = -1;j<k;j++)
            {
                for(int ii = 0;ii<=k+1;ii++)
                {
                    for(int jj = -1;jj<k;jj++)
                    {
                        int new_i = min(i,ii+1);

                        int new_j1 = jj == -1?-1:(k-i>=jj+1?-1:jj+1);
                        int new_j2 = j == -1?-1:(k-ii-1>=j?-1:j);
                        int new_j = max(new_j1,new_j2);

                        f[new_i+1][new_j+1] = (f[new_i+1][new_j+1]+dp[u][i+1][j+1]*dp[v][ii+1][jj+1]%MOD)%MOD;
                    }
                }
            }
        }
        memcpy(dp[u],f,sizeof f);
    }
}
int main()
{
    while(cin>>n>>k)
    {
        FOR(i,1,n)e[i].clear();
        FOR(i,1,n-1)
        {
            int x,y;
            cin>>x>>y;
            e[x].PB(y);
            e[y].PB(x);
        }
        dfs(1,-1);
        ll ans = 0;
        for(int i = 0;i<=k;i++)for(int j = -1;j<k-i;j++)ans = (ans+dp[1][i+1][j+1])%MOD;
        cout<<ans<<endl;
    }
    return 0;
}