#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, q[N], t[N], h, s1, s2, cnt;
struct an {
  int i, j, d;
} ans[N];
struct ddd {
  int i, v;
} a[N], b[N];
bool cmpp(ddd a, ddd b) { return a.v < b.v; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].v), s1 += a[i].v, a[i].i = i;
  sort(a + 1, a + n + 1, cmpp);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i].v), s2 += b[i].v, b[i].i = i;
  sort(b + 1, b + n + 1, cmpp);
  if (s1 != s2) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i].v < b[i].v) {
      q[++h] = b[i].v - a[i].v;
      t[h] = i;
    } else if (a[i].v > b[i].v) {
      int y = a[i].v - b[i].v;
      while (y && h) {
        if (q[h] > y) {
          ans[++cnt].i = a[t[h]].i;
          ans[cnt].j = a[i].i;
          ans[cnt].d = y;
          q[h] -= y;
          y = 0;
        } else {
          ans[++cnt].i = a[t[h]].i;
          ans[cnt].j = a[i].i;
          ans[cnt].d = q[h];
          y -= q[h];
          h--;
        }
      }
      if ((!h) && y) {
        cout << "NO";
        return 0;
        ;
      }
    }
  }
  if (h) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl << cnt << endl;
  for (int i = 1; i <= cnt; ++i) {
    printf("%d %d %d\n", ans[i].i, ans[i].j, ans[i].d);
  }
  return 0;
}
