#include <bits/stdc++.h>
using namespace std;
const int N = 3000005;
struct node {
  int pos, id;
} a[N], b[N];
int st[N], top = 0, n, tot = 0;
long long sum = 0;
int x[N], y[N], dis[N], d[N];
bool cmp(node a, node b) { return a.pos < b.pos; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i].pos);
    a[i].id = i;
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &b[i].pos);
    b[i].id = i;
  }
  sort(a + 1, a + 1 + n, cmp);
  sort(b + 1, b + 1 + n, cmp);
  for (int i = 1; i <= n; ++i) {
    d[i] = b[i].pos - a[i].pos;
    sum += 1ll * d[i];
    if (sum < 0) {
      puts("NO");
      return 0;
    }
  }
  if (sum != 0) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    if (d[i] > 0)
      st[++top] = i;
    else if (d[i] < 0) {
      while (top) {
        int now = st[top];
        int ret = min(b[now].pos - a[now].pos, a[i].pos - b[i].pos);
        a[i].pos -= ret;
        a[now].pos += ret;
        ++tot;
        x[tot] = a[now].id;
        y[tot] = a[i].id;
        dis[tot] = ret;
        if (a[i].pos == b[i].pos) break;
        --top;
      }
    }
  }
  puts("YES");
  printf("%d\n", tot);
  for (int i = 1; i <= tot; ++i) {
    printf("%d %d %d\n", x[i], y[i], dis[i]);
  }
  return 0;
}
