#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
//#define endl "\n"
const ll maxn =6e5+10;
const ll mod=1e9+7;
const ll base=1e18;
vector<pair<pll,ll>> ans;
ll dosth(ll l,ll r)
{
    if (l>1)
    {
        ll h=dosth(1,r-l+1);
        ans.pb(make_pair(make_pair(h,h+1),l-1));
        return h+1;
    }
    if ((r&(-r))==r)
    {
        ll pos;
         for (int j=0;j<35;j++)
         {
             if (r==((1ll<<j)))
             {
                pos=j;
                break;
             }
         }
         ans.pb(make_pair(make_pair(1,2),1));
         for (int j=1;j<=pos;j++)
         {
             ans.pb(make_pair(make_pair(1,j+2),1));
             for (int t=0;t<=j-1;t++)
             {
                 ans.pb(make_pair(make_pair(t+2,j+2),(1ll<<t)));
             }
         }
         return pos+2;
    }
     ll pos;
         for (int j=0;j<35;j++)
         {
             if (r&((1ll<<j)))
             {
                pos=j;
             }
         }
         ll nw=dosth(1,(1ll<<pos));
        ans.pb(make_pair(make_pair(1,nw+1),1));
        ll p=r-1;
        for (int j=0;j<=pos;j++)
        {
            if ((r-1)&(1ll<<j))
            {
                p-=(1ll<<j);
                ans.pb(make_pair(make_pair(j+2,nw+1),p+1));

            }
        }
        return nw+1;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    if (fopen("t.inp","r"))
    {
        freopen("test.inp","r",stdin);
        freopen("test.out","w",stdout);
    }
    ll l, r;
     cin>>l>> r;
      ll n=dosth(l,r);
      cout <<"YES"<<endl;
      cout <<n<<" "<<ans.size()<<endl;
      for (auto p:ans)
      {
          cout <<p.ff.ff<<" "<<p.ff.ss<<" "<<p.ss<<endl;
      }

}
