#include <bits/stdc++.h>
using namespace std;
template <class T>
void rd(T &x) {
  x = 0;
  int f = 1;
  char c;
  while (!isdigit(c = getchar()))
    if (c == '-') f = -1;
  do {
    x = (x << 1) + (x << 3) + (c ^ 48);
  } while (isdigit(c = getchar()));
  x *= f;
}
const int N = 3e5 + 5;
struct ANS {
  int l, r, d;
};
struct node {
  int v, id;
  bool operator<(const node &x) const { return v < x.v; }
} s[N];
vector<ANS> ans;
int t[N], n;
int main() {
  rd(n);
  for (int i = 1; i <= n; i++) rd(s[i].v), s[i].id = i;
  for (int i = 1; i <= n; i++) rd(t[i]);
  sort(s + 1, s + n + 1);
  sort(t + 1, t + n + 1);
  int i = 1, j = 2;
  while (1) {
    if (s[i].v > t[i]) return !printf("NO");
    while (s[j].v <= t[j]) j++;
    while (s[i].v == t[i]) i++;
    if (j >= n + 1 || i > j) break;
    int tmp = min((s[j].v - s[i].v) >> 1, min(t[i] - s[i].v, s[j].v - t[j]));
    if (tmp)
      ans.push_back({s[i].id, s[j].id, tmp}), s[i].v += tmp, s[j].v -= tmp;
  }
  for (int i = 1; i <= n; i++)
    if (s[i].v != t[i]) return !printf("NO");
  cout << "YES" << endl << ans.size() << endl;
  for (auto it : ans) cout << it.l << ' ' << it.r << ' ' << it.d << endl;
  return 0;
}
