#include <bits/stdc++.h>
using namespace std;
void read(long long &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  x *= f;
  return;
}
long long maxt(long long a, long long b) { return a > b ? a : b; }
long long mint(long long a, long long b) { return a < b ? a : b; }
void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x < 10) {
    putchar('0' + x);
    return;
  }
  write(x / 10);
  putchar(x % 10 + '0');
  return;
}
struct node {
  long long a, id;
  bool operator<(node p) const { return a < p.a; }
} s[300005];
long long n, b[300005], ans1[300005 * 5], ans2[300005 * 5], t1, t2,
    ans3[300005 * 5];
int main() {
  read(n);
  for (int i = 1; i <= n; i++) read(s[i].a), s[i].id = i;
  for (int i = 1; i <= n; i++) read(b[i]);
  sort(s + 1, s + 1 + n);
  sort(b + 1, b + 1 + n);
  for (int i = n; i >= 1; i--) {
    t1 += s[i].a, t2 += b[i];
    if (t1 < t2) {
      puts("NO");
      return 0;
    }
  }
  if (t1 != t2) {
    puts("NO");
    return 0;
  }
  long long j = n, len = 0;
  for (int i = n; i && j; i--)
    if (s[i].a > b[i]) {
      long long p = s[i].a - b[i];
      while (j && p) {
        if (b[j] > s[j].a && i != j) {
          if (b[j] - s[j].a < p) {
            p -= b[j] - s[j].a;
            ans1[++len] = s[j].id;
            ans2[len] = s[i].id;
            ans3[len] = b[j] - s[j].a;
            s[j].a = b[j];
          } else {
            s[j].a += p;
            ans1[++len] = s[j].id;
            ans2[len] = s[i].id;
            ans3[len] = p;
            p = 0;
            j++;
          }
        }
        j--;
      }
      s[i].a = b[i] + p;
    }
  puts("YES");
  write(len);
  putchar('\n');
  for (int i = 1; i <= len; i++) {
    write(ans1[i]);
    putchar(' ');
    write(ans2[i]);
    putchar(' ');
    write(ans3[i]);
    putchar('\n');
  }
  return 0;
}
