#include <bits/stdc++.h>
using namespace std;
const long long BIG = 1000000000000000000LL;
void solve();
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
const long long borne = 3 * (long long)(1e5) + 5;
pair<long long, long long> deb[borne];
pair<long long, long long> res[borne];
long long diff[borne];
long long nbStones;
void solve() {
  cin >> nbStones;
  for (long long i = (0); i < (nbStones); ++i) {
    cin >> deb[i].first;
    deb[i].second = i;
  }
  for (long long i = (0); i < (nbStones); ++i) {
    cin >> res[i].first;
    res[i].second = i;
  }
  sort(deb, deb + nbStones);
  sort(res, res + nbStones);
  long long som = 0;
  for (long long i = (0); i < (nbStones); ++i) {
    diff[i] = res[i].first - deb[i].first;
    som += diff[i];
  }
  if (som != 0) {
    cout << "NO\n";
    return;
  }
  vector<pair<pair<long long, long long>, long long>> op;
  long long negDer = 0;
  long long cur = 0;
  while (cur < nbStones) {
    if (diff[cur] <= 0) {
      ++cur;
      continue;
    }
    negDer = max(negDer, (cur + 1));
    while (negDer < nbStones && diff[negDer] >= 0) ++negDer;
    if (negDer >= nbStones) {
      cout << "NO\n";
      return;
    }
    long long rem = min(diff[cur], -diff[negDer]);
    diff[cur] -= rem;
    diff[negDer] += rem;
    op.push_back({{deb[cur].second, deb[negDer].second}, rem});
  }
  cout << "YES\n";
  cout << op.size() << "\n";
  for (auto x : op)
    cout << x.first.first + 1 << " " << x.first.second + 1 << " " << x.second
         << "\n";
}
