#include <bits/stdc++.h>
using namespace std;
int main() {
  int TESTS = 1;
  while (TESTS--) {
    long long i, j, k, l, m, n, a[300005], b[300005], chi[300005];
    vector<pair<long long, long long>> aa, bb;
    cin >> n;
    long long sum1 = 0, sum2 = 0;
    priority_queue<pair<long long, long long>> qi, qd;
    for (i = 0; i < n; i++)
      cin >> a[i], sum1 += a[i], aa.push_back({a[i], i}), chi[i] = 0,
                                                          qd.push({-a[i], i});
    for (i = 0; i < n; i++) cin >> l, sum2 += l, bb.push_back({l, i});
    if (sum1 != sum2) {
      cout << "NO";
      return 0;
    }
    sort((aa).begin(), (aa).end());
    sort((bb).begin(), (bb).end());
    j = 0;
    i = 0;
    vector<pair<long long, pair<long long, long long>>> ans;
    for (k = 0; k < n - 1; k++) {
      for (i; aa[i].first <= bb[k].first && i < n; i++) {
        if (chi[aa[i].second] == 0) qi.push({aa[i].first, aa[i].second});
        if (chi[aa[i].second] == -1) continue;
        if (chi[aa[i].second] > 0) qi.push({chi[aa[i].second], aa[i].second});
      }
      if (qd.empty() || qi.empty()) break;
      pair<long long, long long> pd = qd.top(), pi = qi.top();
      qd.pop();
      qi.pop();
      long long ppp = 1;
      while (-pd.first <= bb[k].first) {
        if (qd.empty()) {
          ppp = 0;
          break;
        }
        pd = qd.top();
        qd.pop();
      }
      if (ppp == 0) break;
      pd.first = -pd.first;
      if (bb[k].first - pi.first <= pd.first - bb[k].first) {
        ans.push_back({pi.second, {pd.second, bb[k].first - pi.first}});
        if (pd.first - (bb[k].first - pi.first) <= bb[k + 1].first) {
          chi[pd.second] = -1;
          qi.push({pd.first - (bb[k].first - pi.first), pd.second});
        } else {
          chi[pd.second] = pd.first - (bb[k].first - pi.first);
          qd.push({-(pd.first - (bb[k].first - pi.first)), pd.second});
        }
      } else {
        chi[pd.second] = -1;
        ans.push_back({pi.second, {pd.second, pd.first - bb[k].first}});
        qi.push({pi.first + (pd.first - bb[k].first), pi.second});
      }
    }
    for (auto i : ans) {
      a[i.first] += i.second.second;
      a[i.second.first] -= i.second.second;
    }
    sort(a, a + n);
    for (i = 0; i < n; i++) {
      if (bb[i].first != a[i]) {
        cout << "NO";
        return 0;
      }
    }
    cout << "YES\n";
    cout << ans.size() << '\n';
    ;
    for (auto i : ans)
      cout << i.first + 1 << " " << i.second.first + 1 << " " << i.second.second
           << '\n';
  }
  return 0;
}
