#include <bits/stdc++.h>
using namespace std;
const int inf = (int)(2e9);
const long long INF = (long long)(5e18);
const int N = 300010;
long long n, sa = 0, sb = 0;
long long s1 = 0, s2 = 0;
struct node {
  long long x, id;
} fa[N], fb[N], a[N], b[N];
vector<long long> v[3];
bool cmp(node p, node q) {
  if (p.x == q.x) return p.id < q.id;
  return p.x < q.x;
}
int main() {
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i].x);
    a[i].id = i;
    sa += a[i].x;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &b[i].x);
    b[i].id = i;
    sb += b[i].x;
  }
  if (sa != sb) {
    puts("NO");
    return 0;
  }
  sort(a + 1, a + n + 1, cmp);
  sort(b + 1, b + n + 1, cmp);
  sa = 0;
  sb = 0;
  for (int i = 1; i <= n; i++) {
    sa += a[i].x;
    sb += b[i].x;
    if (sa > sb) {
      puts("NO");
      return 0;
    }
  }
  sa = 0;
  sb = 0;
  for (int i = n; i >= 1; i--) {
    sa += a[i].x;
    sb += b[i].x;
    if (sa < sb) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i].x < b[i].x) fa[++s1].x = b[i].x - a[i].x, fa[s1].id = i;
    if (a[i].x > b[i].x) fb[++s2].x = a[i].x - b[i].x, fb[s2].id = i;
  }
  long long nowa = 1, nowb = 1;
  while (nowa <= s1 && nowb <= s2) {
    ans++;
    long long xx = fa[nowa].id;
    long long yy = fb[nowb].id;
    if (xx > yy) swap(xx, yy);
    v[0].push_back(a[xx].id);
    v[1].push_back(a[yy].id);
    v[2].push_back(min(fa[nowa].x, fb[nowb].x));
    if (fa[nowa].x == fb[nowb].x) {
      nowa++, nowb++;
    } else if (fa[nowa].x < fb[nowb].x) {
      fb[nowb].x -= fa[nowa].x;
      nowa++;
    } else {
      fa[nowa].x -= fb[nowb].x;
      nowb++;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < ans; i++)
    printf("%lld %lld %lld\n", v[0][i], v[1][i], v[2][i]);
  return 0;
}
