#include <bits/stdc++.h>

using namespace std;

pair<int, vector<tuple<int, int, int>>> get_graph(int l, int r) {
    auto size = [&]() {
        return r - l + 1;
    };
    int k = 3;
    while ((1 << (k - 3)) < size()) {
        ++k;
    }
    vector<tuple<int, int, int>> edges;
    for (int i = 2; i <= k; ++i) {
        for (int j = i + 1; j <= k; ++j) {
            int w = 1 << max(k - j - 1, 0);
            edges.push_back({i, j, w});
        }
    }
    if (l == 1) {
        ++l;
        edges.push_back({1, k, 1});
    }
    for (int j = 2; j <= k - 1; ++j) {
        // Represents intervals [1, 2^{k-j-1}]
        int s = 1 << (k - j - 1);
        if (size() >= s) {
            edges.push_back({1, j, l - 1});
            l += s;
        }
    }
    assert (size() == 0);
    assert (k <= 32);
    return {k, edges};
}

void solve() {
    int l, r;
    cin >> l >> r;
    cout << "YES\n";
    int k;
    vector<tuple<int, int, int>> edges;
    tie(k, edges) = get_graph(l, r);
    cout << k << " " << edges.size() << "\n";
    for (auto e : edges) {
        int u, v, w;
        tie(u, v, w) = e;
        cout << u << " " << v << " " << w << "\n";
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    // # ifndef ONLINE_JUDGE
    // for (int l = 1; l <= 10; ++l) {
    //     for (int r = l; r <= 10; ++r) {
    //         int k;
    //         vector<tuple<int, int, int>> edges;
    //         tie(k, edges) = get_graph(l, r);
    //         vector<vector<pair<int, int>>> adj_list(k);
    //         for (auto e : edges) {
    //             int u, v, w;
    //             tie(u, v, w) = e;
    //             --u;
    //             --v;
    //             adj_list[u].push_back({v, w});
    //         }
    //         set<int> dists;
    //         function<void (int, int)> dfs = [&](int u, int c) {
    //             if (u == k - 1) {
    //                 assert (dists.count(c) == 0);
    //                 dists.insert(c);
    //             }
    //             for (auto e : adj_list[u]) {
    //                 int v, w;
    //                 tie(v, w) = e;
    //                 dfs(v, w + c);
    //             }
    //         };
    //         dfs(0, 0);
    //         if (dists.size() != r - l + 1 || *dists.begin() != l || *dists.rbegin() != r) {
    //             cerr << "l = " << l << "\n";
    //             cerr << "r = " << r << "\n";
    //             for (int d : dists) {
    //                 cerr << "d = " << d << "\n";
    //             }
    //         }
    //         assert (dists.size() == r - l + 1);
    //         assert (*dists.begin() == l);
    //         assert (*dists.rbegin() == r);
    //     }
    // }
    // # endif
    solve();
    return 0;
}