#include <bits/stdc++.h>
using namespace std;
const int N = 3e5;
pair<int, int> a[N];
int b[N];
int n;
struct node {
  int i, j, d;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  sort(b, b + n);
  vector<pair<int, int> > left;
  vector<node> ans;
  for (int i = 0; i < n; ++i) {
    if (b[i] > a[i].first) {
      left.push_back({b[i] - a[i].first, a[i].second});
      continue;
    }
    int del = a[i].first - b[i];
    while (del) {
      if (left.empty()) {
        cout << "NO"
             << "\n";
        return 0;
      }
      int x = min(del, left.back().first);
      left.back().first -= x;
      del -= x;
      ans.push_back({left.back().second, a[i].second, x});
      if (!left.back().first) left.pop_back();
    }
  }
  if (!left.empty()) {
    cout << "NO"
         << "\n";
    return 0;
  }
  cout << "YES"
       << "\n";
  cout << ans.size() << "\n";
  for (auto i : ans) {
    cout << i.i << " " << i.j << " " << i.d << "\n";
  }
  return 0;
}
