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>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 100005



int N,start,goal;
int PARENT[SIZE];
ll T,num_visited[SIZE];

struct Edge{
	Edge(int arg_to,ll arg_weight){
		to = arg_to;
		weight = arg_weight;
		value = -1;
	}
	bool operator<(const struct Edge &arg) const{

		return value < arg.value;
	}

	int to;
	ll weight,value;
};

vector<Edge> G[SIZE];


void dfs(int node_id,int parent){

	PARENT[node_id] = parent;

	bool FLG = false;
	int edge_index;

	vector<Edge> V;

	for(int i = 0; i < G[node_id].size(); i++){

		int child = G[node_id][i].to;
		if(child == parent || child == goal)continue;

		num_visited[child]++;
		dfs(child,node_id);
		G[node_id][i].value = G[node_id][i].weight-num_visited[child]*T;
	}
	sort(G[node_id].begin(),G[node_id].end());

	for(int i = 0; i < G[node_id].size(); i++){

		int child = G[node_id][i].to;
		if(child == parent)continue;

		if(child == goal){

			FLG = true;
			edge_index = i;
			continue;
		}

		G[node_id][i].weight -= (num_visited[node_id]+num_visited[child])*T;
		num_visited[node_id]++;
	}

	if(FLG){ //ゴールは最後に訪れる

		num_visited[goal]++;
		dfs(goal,node_id);
		G[node_id][edge_index].weight -= T*(num_visited[node_id]+num_visited[goal]);
	}
}

int main(){

	scanf("%d %lld %d %d",&N,&T,&start,&goal);
	start--;
	goal--;

	int from,to;
	ll weight;

	for(int loop = 0; loop < N-1; loop++){

		scanf("%d %d %lld",&from,&to,&weight);

		from--;
		to--;

		G[from].push_back(Edge(to,weight));
		G[to].push_back(Edge(from,weight));
	}

	for(int i = 0; i < N; i++){

		num_visited[i] = 0;
	}

	dfs(start,-1);

	//戻りのコストの過剰計上分を直す(戻りはgoalで止まるので、片道分のコストがあれば良い)
	int tmp_node = goal;

	while(true){

		int parent = PARENT[tmp_node];

		if(parent == -1)break;

		for(int i = 0; i < G[parent].size();i++){

			if(G[parent][i].to == tmp_node){

				G[parent][i].weight += num_visited[tmp_node]*T;
				break;
			}
		}

		if(parent == start)break;
		tmp_node = parent;
	}

	for(int i = 0; i < N; i++){
		for(int k = 0; k < G[i].size(); k++){
			if(G[i][k].weight <= 0){

				printf("No\n");
				return 0;
			}
		}
	}

	printf("Yes\n");

	return 0;
}

