#include <bits/stdc++.h>
using namespace std;
int n, m, sl, fh, s[300010], l[300010], r[300010];
long long sum;
struct node {
  int i, p;
  bool operator<(const node &x) const { return p < x.p; }
} a[300010];
struct typ {
  int x, y, d;
};
vector<typ> ans;
int rd() {
  sl = 0;
  fh = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') sl = sl * 10 + ch - '0', ch = getchar();
  return sl * fh;
}
int main() {
  n = rd();
  int x, d;
  for (int i = 1; i <= n; ++i) a[i].i = i, a[i].p = rd();
  for (int i = 1; i <= n; ++i) s[i] = rd();
  sort(a + 1, a + n + 1);
  sort(s + 1, s + n + 1);
  for (int i = 1; i <= n; ++i) {
    if (s[i] > a[i].p)
      l[++*l] = i;
    else if (s[i] < a[i].p)
      r[++*r] = i;
    sum += s[i] - a[i].p;
    if (sum < 0) {
      puts("NO");
      return 0;
    }
  }
  if (sum != 0) {
    puts("NO");
    return 0;
  }
  x = 1;
  for (int i = 1; i <= *l; ++i)
    while (a[l[i]].p != s[l[i]]) {
      while (x <= *r && a[r[x]].p == s[r[x]]) x++;
      d = min(s[l[i]] - a[l[i]].p, a[r[x]].p - s[r[x]]);
      ans.push_back((typ){a[l[i]].i, a[r[x]].i, d});
      a[l[i]].p += d;
      a[r[x]].p -= d;
    }
  puts("YES");
  printf("%d\n", x = (int)ans.size());
  for (int i = 0; i < x; ++i)
    printf("%d %d %d\n", ans[i].x, ans[i].y, ans[i].d);
  return 0;
}
