#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

vector<P> v[111111];
set<P> se;
map<P,ll> ma,m2;
ll n,m,s,t,ff=0;

void dfs(ll x,ll p) {
  rep(i,v[x].size()) {
    P q=v[x][i];
    ll y=q.S;
    if(se.count(P(x,y))) continue;
    ma[P(x,y)]-=m;
    ma[P(y,x)]-=m;
    if(y==p) continue;
    dfs(y,x);
    if(ma[P(x,y)]<=0) ff=1;
  }
}

void Main() {
  cin >> n >> m >> s >> t;
  s--,t--;
  rep(i,n-1) {
    int x,y,z;
    cin >> x >> y >> z;
    x--,y--;
    v[x].pb(P(z,y));
    v[y].pb(P(z,x));
    ma[P(x,y)]=ma[P(y,x)]=z;
    m2[P(x,y)]=m2[P(y,x)]=z;
  }
  rep(i,v[s].size()) {
    ma[P(s,v[s][i].S)]+=m;
    ma[P(v[s][i].S,s)]+=m;
  }
  rep(i,n) sort(all(v[i]));
  /*
  rep(i,n) {
    sort(all(v[i]));
    rep(j,v[i].size()) {
      P p=P(i,v[i][j]),q=P(v[i][j],i);
      ma[p]-=v[i].size()*m;
      ma[q]-=v[i].size()*m;
    }
  }
  */
  queue<ll> que;
  ll d[n],u[n],p[n];
  mem(d),mem(u);memset(p,-1,sizeof(p));
  que.push(s);
  u[s]=1;
  bool f=0;
  while(!que.empty()) {
    ll x=que.front();que.pop();
    if(x==t) f=1;
    rep(i,v[x].size()) {
      ll y=v[x][i].S;
      if(u[y]) continue;
      m2[P(x,y)]-=(v[x].size()-1)*m;
      m2[P(y,x)]-=(v[x].size()-1)*m;
    }
    rep(i,v[x].size()) {
      ll y=v[x][i].S;
      if(u[y]) continue;
      if(m2[P(x,y)]<=0) continue;
      u[y]=1;
      p[y]=x;
      que.push(y);
    }
  }
  if(!f) {
    pr("No");
    return;
  }
  vector<ll> g;
  while(t!=s) {
    g.pb(t);
    t=p[t];
  }
  g.pb(s);
  rep(x,g.size()-1) {
    int y=g[x+1];
    se.in(P(x,y));
    se.in(P(y,x));
  }
  dfs(s,-1);
  if(s!=t) dfs(t,-1);
  if(ff) pr("No");
  else pr("Yes");
  /*
  tr(it,ma) {
    if(se.count(it->F)) continue;
    P p=it->F;
    pr(p.F,p.S,it->S);
    if(it->S<0) {
      pr("No");
      return;
    }
  }
  pr("Yes");
  */
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}

