#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5;
struct second {
  long long val;
  int id;
} a[maxn + 10], b[maxn + 10];
struct ss2 {
  int x, y;
  long long d;
} rez[5 * maxn + 10];
int ba, n, br, lp;
pair<long long, int> stek[maxn + 10];
bool srt(second aa, second bb) { return aa.val < bb.val; }
void pisi(int x, int y, long long d) { rez[++ba] = {x, y, d}; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i].val);
    a[i].id = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &b[i].val);
    b[i].id = i;
  }
  sort(a + 1, a + n + 1, srt);
  sort(b + 1, b + n + 1, srt);
  lp = 1;
  long long pom = 0;
  for (int i = 1; i <= n; i++) {
    pom += a[i].val - b[i].val;
    if (a[i].val == b[i].val) continue;
    if (a[i].val < b[i].val)
      stek[++br] = {b[i].val - a[i].val, a[i].id};
    else {
      long long diff = a[i].val - b[i].val;
      while (lp <= br) {
        if (diff >= stek[lp].first) {
          pisi(stek[lp].second, a[i].id, stek[lp].first);
          diff -= stek[lp].first;
          lp++;
          if (!diff) break;
        } else {
          pisi(stek[lp].second, a[i].id, diff);
          stek[lp].first -= diff;
          break;
        }
      }
      if (lp > br && diff) {
        printf("NO\n");
        return 0;
      }
    }
  }
  if (br >= lp) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n%d\n", ba);
  for (int i = 1; i <= ba; i++) {
    printf("%d %d %lld\n", rez[i].x, rez[i].y, rez[i].d);
  }
  return 0;
}
