#include <bits/stdc++.h>
using namespace std;
int n, s[300005], t[300005], d[300005], p[300005];
vector<int> I, J, D;
bool cmp(int A, int B) { return s[A] < s[B]; }
int main() {
  int i, j, k;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) p[i] = i;
  for (i = 0; i < n; ++i) scanf("%d", s + i);
  for (i = 0; i < n; ++i) scanf("%d", t + i);
  sort(p, p + n, cmp);
  sort(s, s + n);
  sort(t, t + n);
  int ts = 0;
  for (i = 0; i < n; ++i) {
    d[i] = t[i] - s[i];
    ts += d[i];
  }
  if (ts) {
    printf("NO\n");
    return 0;
  }
  int ptr = 0;
  for (i = 0; i < n; ++i) {
    if (d[i] <= 0) continue;
    while (d[i]) {
      while (ptr < n && (d[ptr] >= 0 || ptr <= i)) ++ptr;
      if (ptr == n) {
        printf("NO\n");
        return 0;
      }
      int req = min(d[i], -d[ptr]);
      d[i] -= req;
      d[ptr] += req;
      I.push_back(p[i] + 1);
      J.push_back(p[ptr] + 1);
      D.push_back(req);
    }
  }
  for (i = 0; i < n; ++i) {
    if (d[i]) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n%d\n", (int)I.size());
  for (i = 0; i < (int)I.size(); ++i) {
    printf("%d %d %d\n", I[i], J[i], D[i]);
  }
  return 0;
}
