#include <iostream>
#include <stdio.h>
#include <string.h>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <math.h>
#include <random>
#include <chrono>
#include <assert.h>
#include <ctime>

using namespace std;

#define x first
#define y second
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define all(x) x.begin(),x.end()
#define SZ(x) int(x.size())
#define rep(i, a, b) for(int i = a; i < b; i++)
#define per(i, a, b) for(int i = b-1; i >= a; i--)
#define DBG(x) cerr << (#x) << "=" << x << "\n";
#define ll long long
#define inf 1000000007
#define mod 1000000007
#define N 100005

template<typename U, typename V> void Min(U &a, const V & b){if(a > b)a = b;}
template<typename U, typename V> void Max(U &a, const V & b){if(a < b)a = b;}
template<typename U, typename V> void add(U &a, const V & b){a = (a + b) % mod;}
template<typename U> U gcd(U a, U b){
    if(a == 0)return b;
    if(b == 0)return a;
    if(a >= b)return gcd(a % b, b);
    else return gcd(a, b % a);
}
int pow(int a, int b){
    int ans = 1;
    while(b){
        if(b & 1)ans = 1LL * ans * a % mod;
        a = 1LL * a * a % mod;
        b >>= 1;
    }
    return ans;
}
int pow(int a, ll b, int c){
    int ans = 1;
    while(b){
        if(b & 1)ans = 1LL * ans * a % c;
        a = 1LL * a * a % c;
        b >>= 1;
    }
    return ans;
}

vector<pair<int, pii>> ans;
void add_edge(int a, int b, int c){
  ans.pb({a, {b, c}});
}
int solve(int l, int r){
  if(l > 1){
    int k = solve(1, r - l + 1);
    add_edge(k, k+1, l-1);
    return k + 1;
  }
  if((r & (r-1)) == 0) {
    int k = 0;
    per(i, 0, 30)if(r >> i & 1){
      k = i;
      break;
    }
    //cerr << r << " " << k << "\n";
    add_edge(1, 2, 1);
    rep(i, 3, k+3){
      add_edge(1, i, 1);
      rep(j, 2, i){
        add_edge(j, i, 1<<j-2);
      }
    }
    return k + 2;
  }
  int k = 0;
  while(1<<(k+1) <= r-1)k++;
  solve(1, 1<<k);
  add_edge(1, k+3, 1);
  rep(i, 0, k+1)if((r-1) >> i & 1){
    add_edge(i+2, k+3, 1 + ((r-1) >> (i+1) << (i+1)));
  }
  return k + 3;
}
int main(){
  int ca = 0, T, i, j, k, K, m, n;
  int l, r;
  scanf("%d%d", &l, &r);
  K = solve(l, r);
  printf("YES\n%d %d\n", K, SZ(ans));
  for(auto &o : ans){
    printf("%d %d %d\n", o.x, o.y.x, o.y.y);
  }
}
