#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300005;
int s[MAXN], t[MAXN], id[MAXN], n;
struct Tri {
  int a, b, c;
};
vector<Tri> vec;
int main() {
  scanf("%d", &n);
  long long aa = 0, bb = 0;
  for (int i = 1; i <= n; i++) id[i] = i;
  for (int i = 1; i <= n; i++) scanf("%d", s + i), aa += s[i];
  for (int i = 1; i <= n; i++) scanf("%d", t + i), bb += t[i];
  if (aa != bb) return puts("NO") * 0;
  sort(id + 1, id + 1 + n, [&](int x, int y) { return s[x] < s[y]; });
  sort(s + 1, s + 1 + n);
  sort(t + 1, t + 1 + n);
  for (int i = 1, j = 1; i <= n; i++) {
    if (s[i] > t[i]) return puts("NO") * 0;
    while (s[i] < t[i]) {
      while (s[j] <= t[j]) ++j;
      int a = min(s[j] - t[j], t[i] - s[i]);
      s[i] += a, s[j] -= a;
      vec.push_back((Tri){id[i], id[j], a});
    }
  }
  printf("YES\n%d\n", (int)vec.size());
  for (Tri t : vec) printf("%d %d %d\n", t.a, t.b, t.c);
  return 0;
}
