#include #include using namespace std; using namespace atcoder; typedef long long ll; typedef long double ld; typedef pair P; typedef pair Pi; #define rep(i,n) for(ll i=0;i=0;i--) #define rFOR(i,a,b) for(ll i=a-1;i>=b;i--) #define all(x) (x).begin(),(x).end() #define fi first #define se second #define endl "\n" istream &operator>>(istream &is, modint &a) { long long v; is >> v; a = v; return is; } ostream &operator<<(ostream &os, const modint &a) { return os << a.val(); } istream &operator>>(istream &is, modint998244353 &a) { long long v; is >> v; a = v; return is; } ostream &operator<<(ostream &os, const modint998244353 &a) { return os << a.val(); } istream &operator>>(istream &is, modint1000000007 &a) { long long v; is >> v; a = v; return is; } ostream &operator<<(ostream &os, const modint1000000007 &a) { return os << a.val(); } template inline bool chmax(T &a, T b){if(a inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;} template ostream& operator<<(ostream& s,const complex& d) {return s<<"("< ostream& operator<<(ostream& s,const pair& d) {return s<<"("< ostream& operator<<(ostream& s, const vector& d){int len=d.size();rep(i,len){s< ostream& operator<<(ostream& s,const vector>& d){int len=d.size();rep(i,len){s< ostream& operator<<(ostream& s,const set& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;} template ostream& operator<<(ostream& s,const multiset& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;} template ostream& operator<<(ostream& s,const map& m){s<<"{"< vector make_vec(size_t n, T a) { return vector(n, a); } template auto make_vec(size_t n, Ts... ts) { return vector(n, make_vec(ts...)); } const ll mod=1'000'000'007; const ll inf=1'000'000'000'000'000'00; const int INF=1'000'000'000; const double EPS=1e-10; const double PI=acos(-1); using mint=modint1000000007; int main(){ cin.tie(0);ios::sync_with_stdio(false); int n,k; cin>>n>>k; vector> g(n); rep(i,n-1){ int a,b; cin>>a>>b; g[a].push_back(b); g[b].push_back(a); } auto dp=make_vec(n,n+1,2,mint(0)); auto sz=make_vec(n,0); auto dfs=[&](auto &&dfs,int v,int pre)->void{ sz[v]=1; dp[v][1][1]=1; dp[v][0][0]=1; for(auto &&to:g[v]){ if(to==pre) continue; dfs(dfs,to,v); int x=sz[v],y=sz[to]; auto ndp=make_vec(x+y+1,2,mint(0)); rep(i,x+1)rep(j,y+1){ ndp[i+j][0]+=dp[v][i][0]*dp[to][j][0]; ndp[i+j][0]+=dp[v][i][0]*dp[to][j][1]; ndp[i+j][1]+=dp[v][i][1]*dp[to][j][1]; } sz[v]+=sz[to]; dp[v]=ndp; } }; dfs(dfs,0,-1); cout<