#include <bits/stdc++.h>
using pii = std::pair<long long, long long>;
using namespace std;
const long long maxn = 3e5 + 5;
long long n, s, t, curpos[maxn];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  vector<pii> svals, tvals;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    svals.push_back({s, i});
    curpos[i] = s;
  }
  for (long long i = 0; i < n; i++) {
    cin >> t;
    tvals.push_back({t, i});
  }
  sort(svals.begin(), svals.end());
  sort(tvals.begin(), tvals.end());
  deque<pii> canuse;
  vector<pair<pii, long long>> ops;
  for (long long i = 0; i < n; i++) {
    long long to = tvals[i].first;
    long long from = curpos[svals[i].second];
    long long req = abs(to - from);
    if (from < to)
      canuse.push_back({req, i});
    else {
      stack<pii> temp;
      while (!canuse.empty() && req > 0) {
        long long take = min(canuse.front().first, req);
        take = min(take, (curpos[svals[i].second] -
                          curpos[svals[canuse.front().second].second]) /
                             2);
        if (take > 0) {
          curpos[svals[i].second] -= take;
          curpos[svals[canuse.front().second].second] += take;
          req -= take;
          canuse.front().first -= take;
          ops.push_back(
              {{svals[canuse.front().second].second, svals[i].second}, take});
        }
        if (canuse.front().first > 0) temp.push(canuse.front());
        canuse.pop_front();
      }
      if (req > 0) {
        cout << "NO\n";
        return 0;
      }
      while (!temp.empty()) {
        canuse.push_front(temp.top());
        temp.pop();
      }
    }
  }
  while (!canuse.empty() && canuse.front().first == 0) canuse.pop_front();
  if (!canuse.empty()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  assert(ops.size() <= 5 * n);
  cout << ops.size() << "\n";
  for (auto x : ops)
    cout << x.first.first + 1 << " " << x.first.second + 1 << " " << x.second
         << "\n";
  return 0;
}
