#include <bits/stdc++.h>
using namespace std;
int n, tot, top;
struct Node {
  int pos, id;
  friend bool operator<(const Node &A, const Node &B) { return A.pos < B.pos; }
} num[300080], aim[300080];
struct ANS {
  int le, ri, d;
} ans[300080];
long long sum;
int sta[300080];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &num[i].pos), num[i].id = i;
  for (int i = 1; i <= n; ++i) scanf("%d", &aim[i].pos), aim[i].id = i;
  sort(num + 1, num + n + 1);
  sort(aim + 1, aim + n + 1);
  for (int i = 1; i <= n; ++i) {
    sum += (long long)(aim[i].pos - num[i].pos);
    if (sum < 0) {
      puts("NO");
      return 0;
    }
  }
  if (sum != 0) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = 1; i <= n; ++i) {
    if (aim[i].pos == num[i].pos) continue;
    if (aim[i].pos > num[i].pos)
      sta[++top] = i;
    else {
      while (top > 0) {
        int tmp =
            min(aim[sta[top]].pos - num[sta[top]].pos, num[i].pos - aim[i].pos);
        num[sta[top]].pos += tmp;
        num[i].pos -= tmp;
        ans[++tot] = (ANS){num[sta[top]].id, num[i].id, tmp};
        if (num[sta[top]].pos == aim[sta[top]].pos) top--;
        if (num[i].pos == aim[i].pos) break;
      }
    }
  }
  printf("%d\n", tot);
  for (int i = 1; i <= tot; ++i)
    printf("%d %d %d\n", ans[i].le, ans[i].ri, ans[i].d);
  return 0;
}
