problem

There are $ N $ islands numbered from $ 1 $ to $ N $.
Each island has $ N-1 $ bridges, allowing any $ 2 $ island to move to each other across several bridges.
Each bridge has durability, and the durability of the $ i $ th bridge given the input is $ w_i $.
There are $ 1 $ treasures on each island, and you can pick them up while you're on the island.

Yebi, who is currently on the island $ S $, wants to carry all the treasures to the museum on the island $ E $.
Since yebi has ✝ magical power ✝, every time he visits the island $ v $, the durability of all bridges coming out of $ v $ is reduced by $ T $.
When the durability of the bridge drops below $ 0 $, the bridge collapses and cannot be crossed after that.
Can yebi deliver all the treasures to the museum?
However, since yebi is powerful, he can carry as many treasures as he wants at the same time.



output

Output "Yes" if you can deliver all the treasures to the museum, otherwise output "No".
Also, output a line break at the end.

Example

Input

4 10 1 4
1 2 52
1 3 68
3 4 45


Output

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

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;}

int N,S,E,T;
map<pint,int>W;
vint G[111111];

int num[111111];
bool uku[111111];
bool predfs(int v,int p){
	bool ret=false;
	for(auto u:G[v]){
		if(u==p)continue;
		ret|=predfs(u,v);
	}
	if(v==E)ret=true;
	uku[v]=ret;
	return ret;
}

bool dfs(int v,int p){
	int nex=-1;
	vint lis;
	for(auto u:G[v]){
		if(u==p)continue;
		if(uku[u]){
			nex=u;
		}
		else{
			num[u]++;
			if(!dfs(u,v))return false;
			lis.pb(W[pint(u,v)]-num[u]*T);
		}
	}
	sort(all(lis));
	rep(i,lis.size()){
		if(lis[i]-num[v]*T<=0)return false;
		num[v]++;
	}

	if(nex==-1)return true;
	if((num[v]+num[nex])*T>=W[pint(v,nex)])return false;
	num[nex]++;
	return dfs(nex,v);
}

signed main(){
	cin>>N>>T>>S>>E;
	S--;E--;
	rep(i,N-1){
		int a,b,w;
		cin>>a>>b>>w;
		a--;b--;
		G[a].pb(b);G[b].pb(a);W[pint(a,b)]=W[pint(b,a)]=w;
	}

	predfs(S,-1);
	if(dfs(S,-1))cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}
