#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ans = 0, fh = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    ans = (ans << 1) + (ans << 3) + ch - '0', ch = getchar();
  return ans * fh;
}
const int maxn = 3e5 + 100;
struct node {
  int x, y, z;
} ans[maxn * 5];
int n, a[maxn], t[maxn], st[maxn], tp, Ans;
pair<int, int> s[maxn];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) s[i] = make_pair(read(), i);
  for (int i = 1; i <= n; i++) t[i] = read();
  sort(s + 1, s + n + 1), sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; i++) a[i] = t[i] - s[i].first;
  for (int i = 1; i <= n; i++) {
    if (a[i] > 0)
      st[++tp] = i;
    else {
      while (tp && a[i] < 0) {
        if (-a[i] >= a[st[tp]]) {
          ans[++Ans] = (node){s[st[tp]].second, s[i].second, a[st[tp]]};
          a[i] += a[st[tp]], a[st[tp]] = 0, tp--;
        } else {
          ans[++Ans] = (node){s[st[tp]].second, s[i].second, -a[i]};
          a[st[tp]] += a[i], a[i] = 0;
        }
      }
      if (a[i] < 0) {
        printf("NO\n");
        return 0;
      }
    }
  }
  if (tp) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  printf("%d\n", Ans);
  for (int i = 1; i <= Ans; i++)
    printf("%d %d %d\n", ans[i].x, ans[i].y, ans[i].z);
  return 0;
}
