#include <bits/stdc++.h>
using namespace std;
long long a, s, g, h, j, k, l, i, n, m;
pair<long long, int> d[300005], f[300005];
stack<pair<int, int> > q;
vector<pair<int, pair<int, int> > > v;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> d[i].first;
    k += d[i].first;
    d[i].second = i;
  }
  for (i = 0; i < n; i++) {
    cin >> f[i].first;
    k -= f[i].first;
    f[i].second = i;
  }
  sort(d, d + n);
  sort(f, f + n);
  if (k) {
    cout << "NO";
    return 0;
  }
  for (i = 0; i < n; i++) {
    k = f[i].first - d[i].first;
    if (k > 0) {
      q.push({k, d[i].second});
      continue;
    }
    while (q.size() && k < 0) {
      if (-k <= q.top().first) {
        v.push_back({q.top().second, {d[i].second, -k}});
        q.top().first += k;
        k = 0;
        if (!q.top().first) q.pop();
        break;
      }
      v.push_back({q.top().second, {d[i].second, q.top().first}});
      k += q.top().first;
      q.pop();
    }
    if (k < 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) {
    cout << v[i].first + 1 << " " << v[i].second.first + 1 << " "
         << v[i].second.second << endl;
  }
}
