#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

typedef pair<int,int>P;
#define F first
#define S second

int n,T,s,t;
vector<P>v[100009];
int E_aru[100009];


void END(){
  cout<<"No"<<endl;
  exit(0);
}

void YEAY(){
  cout<<"Yes"<<endl;
  exit(0);
}



int dfs0(int x,int par);

int dfs(int x,int par){

  //cout<<x<<' '<<E_aru[x]<<endl;

  int ofset = -T;
  int p_cost=-1;
  if(x==s)ofset=0;

  vector<P>vec;
  //cout<<v[x].size()<<endl;
  r(i,v[x].size()){
    //v[x][i].S -= T;
    //cout<<v[x][i].F<<' '<<E_aru[x]<<endl;
    if(E_aru[x] == v[x][i].F)continue;
    if(v[x][i].F == par){
      p_cost = i;
      v[x][p_cost].S -= T;
      continue;
    }
    vec.push_back( P(v[x][i].S,i) );
  }

  sort(vec.begin(),vec.end());

  r(i,vec.size()){

    if(v[x][vec[i].S].S + ofset <=0 )END();

    //cout<<"AAA"<<v[x][vec[i].S].F<<' '<<ofset<<endl;
    dfs( v[x][vec[i].S].F , x );

    if(p_cost != -1)v[x][p_cost].S -= T;
    //v[x][vec[i].S].S -= ofset;
    ofset -= T;
  }

  //cout<<x<<' '<<E_aru[x]<<endl;

  if(E_aru[x] != -1){
    r(i,v[x].size()){
      //cout<<v[x][vec[i].S].F<<endl;
      if(E_aru[x] != v[x][i].F)continue;
      //cout<<"BBB"<<v[x][i].F<<' '<<' '<<v[x][i].S<<' '<<ofset<<endl;
      if(v[x][i].S +  ofset <=0 )END();
      dfs( E_aru[x] , x );
    }
  }

  if(x==t)YEAY();

  if(p_cost != -1 &&  v[x][p_cost].S <= 0)END();
}


signed main(){
  memset(E_aru,-1,sizeof(E_aru));
  cin>>n;
  cin>>T>>s>>t; s--; t--;

  r(i,n-1){
    int a,b,c;
    cin>>a>>b>>c; a--; b--;
    v[a].push_back(P(b,c));
    v[b].push_back(P(a,c));
  }

  dfs0(s,-1);
  dfs(s,-1);

  cout<<"DAME"<<endl;
  exit(1);
}





int dfs0(int x,int par){
  if(x==t)return 1;
  int res=0;
  r(i,v[x].size()){
    if(v[x][i].F==par)continue;
    int X=dfs0(v[x][i].F,x);
    if(X==1)E_aru[x] = v[x][i].F , res=1;
  }
  return res;
}
