#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#include <map>
#include <queue>
using namespace std;
typedef long long ll;

ll n, t, s, e;
ll weight[100010];
vector<pair<int, int>> G[100010];
vector<int> rt, last;
map<ll, ll> ed;
bool tk[100010] = {}, ans = 1, one_d[100010] = {};

void route(int k) {
    tk[k] = true;
    rt.push_back(k);
    if (k == e) last = rt; 
    for (int i = 0; i < G[k].size(); i++) {
        if (!tk[G[k][i].first]) route(G[k][i].first);
    }
    rt.pop_back();
}

void dfs(int k) {
    //cout << k << endl;
    vector<ll> l;
    ll lst = 1e9;
    tk[k] = true;
    for (int i = 0; i < G[k].size(); i++) {
        if (!tk[G[k][i].first]) {
            dfs(G[k][i].first);
            if (one_d[G[k][i].second]) lst = weight[G[k][i].second];
            else l.push_back(weight[G[k][i].second]);
        }
    }
    sort(l.begin(), l.end());
    //cout << k << ":";
    //for (int i = 0; i < l.size(); i++) cout << " " << l[i];
    //cout << endl;
    //cout << lst << endl;
    for (int i = 0; i < l.size(); i++) {
        if ((i + 1) * t >= l[i]) {
            ans = false;
            return ;
        }
    }
    if (k == s) {
        if (l.size() * t >= lst) {
            ans = false;
            return ;
        }
    }
    else {
        if ((l.size() + 1) * t >= lst) {
            ans = false;
            return ;
        }
    }
    
}

int main() {
    cin >> n >> t >> s >> e;
    s--;  e--;

    for (int i = 0; i < n - 1; i++) {
        ll a, b, w;
        cin >> a >> b >> w;
        a--;  b--;
        G[a].emplace_back(b, i);
        G[b].emplace_back(a, i);
        if (a > b) {
            int tmp = a;
            a = b;  b = tmp;
        }
        weight[i] = w;
        ed[a * n + b] = i;
    }

    route(s);
    for (int i = 0; i < last.size() - 1; i++) {
        int x = last[i], y = last[i + 1];
        if (x > y) {
            int tmp = y;
            y = x;  x = tmp;
        }
        one_d[ed[x * n + y]] = true;
    }
    
    for (int i = 0; i < n; i++) tk[i] = false;
    dfs(s);

    cout << (ans ? "Yes" : "No") << endl;
}
