#include <bits/stdc++.h>
using namespace std;
void no() {
  cout << "NO";
  exit(0);
}
int main() {
  cout << setprecision(20);
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  vector<pair<long long, long long>> s(n);
  vector<pair<long long, long long>> t(n);
  for (int k = 0; k < n; ++k) {
    long long x;
    cin >> x;
    s[k] = make_pair(x, k);
  }
  for (int l = 0; l < n; ++l) {
    long long x;
    cin >> x;
    t[l] = make_pair(x, l);
  }
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  long long cumm = 0;
  vector<long long> shifts(n);
  long long ups = 0;
  long long downs = 0;
  for (int i = 0; i < n; ++i) {
    long long shift = t[i].first - s[i].first;
    shifts[i] = shift;
    cumm += shift;
    if (cumm < 0) no();
    if (shift > 0) ++ups;
    if (shift < 0) ++downs;
  }
  if (cumm != 0) no();
  cout << "YES\n";
  vector<vector<long long>> x;
  int j = 0;
  for (int i = 0; i < n; ++i) {
    while (shifts[i] > 0) {
      while (j < n && shifts[j] >= 0) ++j;
      if (shifts[i] <= 0) continue;
      long long d = min(abs(shifts[i]), abs(shifts[j]));
      assert(d > 0);
      shifts[i] -= d;
      shifts[j] += d;
      x.push_back({s[i].second + 1, s[j].second + 1, d});
    }
  }
  assert(x.size() < n * 5);
  cout << x.size() << endl;
  for (auto ans : x) {
    cout << ans[0] << " " << ans[1] << " " << ans[2] << "\n";
  }
  return 0;
}
