#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
vector<vector<int> > g;
vector<vector<int> > c;
int N, T, S, E;
vector<int>A;
bool found = false;
void dfs1(int a, int p = -1) {
	if (a == S) {
		found = true;
		return;
	}
	for (int i = 0; i < g[a].size(); i++) {
		if (p != g[a][i]) {
			A[a] = g[a][i];
			dfs1(g[a][i], a);
			if (found) {
				break;
			}
		}
	}

}

bool start = false;
bool ok = true;
void dfs2(int a, int p, int C) {
	//cerr << a + 1 << " " << C << endl;
	int times = 0;
	if (!start && a == S) {
		start = true;
	}
	else if(start){
		
		times++;
	}
	vector<pair<int, int> > vp;
	for (int i = 0; i < g[a].size(); i++) {
		if (p != g[a][i]) {
			vp.emplace_back(c[a][i] - T * (g[g[a][i]].size()), i);
		}
	}
	if (!start) {
		for (int i = 0; i < vp.size(); i++) {
			if (g[a][vp[i].second] == A[a]) {
				swap(vp[i], vp.back());
				vp.pop_back();
			}
		}


		for (int i = 0; i < g[a].size(); i++) {
			if(g[a][i] == A[a]){
				dfs2(A[a], a, c[a][i]);
			}
		}
		times++;
	}
	
	sort(vp.begin(), vp.end());
	for (int ii = 0; ii < vp.size(); ii++) {
		int i = vp[ii].second;
		dfs2(g[a][i], a, c[a][i] - T * times);
		times++;
	}
	if (C - T * times <= 0) {
		//cerr << a + 1 << " " << times << endl;
		ok = false;
	}
}


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N >> T >> S >> E;
	S--; E--;
	g.resize(N);
	c.resize(N);
	A.resize(N, -1);
	int res = 0;
	int a, b, cost;
	for (int i = 0; i < N - 1; i++) {
		cin >> a >> b >> cost; a--; b--;
		g[a].push_back(b);
		c[a].push_back(cost);
		g[b].push_back(a);
		c[b].push_back(cost);
	}
	dfs1(E);

	int INF = (int)1 << 60;
	dfs2(E, -1, INF);
	if (ok) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}
