#include<bits/stdc++.h>
#define io_o() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define fst first
#define scd second
#define endl "\n"
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define REP(i,n) for(int i = 0; i < n; i++)
#define print1d(a) for(auto v: a) cout << v << " "; cout << endl;
#define int ll

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

vector<pair<pii, int>> edges;

inline void addedge(int x, int y, int c){
    // cout << x << " " << y << " " << c << endl;
    edges.pb({{x, y}, c});
}

int solve(int L, int R)
{
	if (L > 1)
	{
		int k = solve(1, R - L + 1);
		addedge(k, k + 1, L - 1);
		return k + 1;
	}
	if ((R & -R) == R) // if L == 1 and R is a power of 2
	{
		int k = __builtin_ctz(R);
		addedge(1, 2, 1);
		for (int i = 3; i <= k + 2; ++i)
		{
			addedge(1, i, 1);
			for (int j = 2; j < i; ++j)
				addedge(j, i, 1 << (j - 2));
		}
		return k + 2;
	}
	int k = 0;
	while (1 << (k + 1) <= R - 1) ++k;
	solve(1, 1 << k);
	addedge(1, k + 3, 1);
	for (int i = 0; i <= k; ++i)
		if ((R - 1) >> i & 1)
			addedge(i + 2, k + 3, 1 + ((R - 1) >> (i + 1) << (i + 1)));
	return k + 3;
}
 
int32_t main(){
    io_o(); 
    int l, r; cin >> l >> r;
    int n = solve(l, r);
    cout << "YES" << endl;
    cout << n << " " << edges.size() << endl;
    sort(ALL(edges));
    for(auto e: edges){
        cout << e.fst.fst << " " << e.fst.scd << " " << e.scd << endl;
    }
    return 0;
}

