#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long re = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) re = (re << 1) + (re << 3) + ch - '0', ch = getchar();
  return re * flag;
}
long long n, a[300010], b[300010], sum[300010], pos[300010];
long long st[300010], top;
long long al[1000010], ar[1000010], ad[1000010], cnta = 0;
inline bool cmp(long long l, long long r) { return a[l] < a[r]; }
int main() {
  n = read();
  long long i, tmp;
  long long s1 = 0, s2 = 0;
  for (i = 1; i <= n; i++) a[i] = read(), s1 += a[i], pos[i] = i;
  for (i = 1; i <= n; i++) b[i] = read(), s2 += b[i];
  sort(pos + 1, pos + n + 1, cmp);
  sort(b + 1, b + n + 1);
  sort(a + 1, a + n + 1);
  if (s1 != s2) {
    puts("NO");
    return 0;
  }
  for (i = 1; i <= n; i++) {
    a[i] = b[i] - a[i];
    sum[i] = sum[i - 1] + a[i];
    if (sum[i] < 0) {
      puts("NO");
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    if (a[i] > 0) st[++top] = i;
    if (a[i] < 0) {
      tmp = -a[i];
      while (top && tmp >= a[st[top]])
        cnta++, al[cnta] = st[top], ar[cnta] = i,
                tmp -= (ad[cnta] = a[st[top--]]);
      if (tmp)
        cnta++, al[cnta] = st[top], ar[cnta] = i,
                a[st[top]] -= (ad[cnta] = tmp);
    }
  }
  cout << "YES" << '\n';
  cout << cnta << '\n';
  for (i = 1; i <= cnta; i++) {
    printf("%I64d %I64d %I64d\n", pos[al[i]], pos[ar[i]], ad[i]);
  }
}
