#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
int s[N], t[N], seq[N], n;
vector<tuple<int, int, int>> res;
stack<pair<int, int>> act;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> t[i];
  }
  iota(seq, seq + n, 0);
  sort(seq, seq + n, [&](int a, int b) { return s[a] < s[b]; });
  sort(t, t + n);
  for (int i = 0; i < n; ++i) {
    int dist = t[i] - s[seq[i]];
    if (dist > 0) {
      act.emplace(seq[i], dist);
    } else {
      dist = -dist;
      while (dist > 0 && !act.empty()) {
        int S = min(act.top().second, dist);
        act.top().second -= S;
        dist -= S;
        res.emplace_back(act.top().first, seq[i], S);
        if (act.top().second == 0) {
          act.pop();
        }
      }
      if (dist > 0) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  if (!act.empty()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n" << res.size() << "\n";
  for (auto i : res) {
    int a, b, c;
    tie(a, b, c) = i;
    cout << a + 1 << " " << b + 1 << " " << c << "\n";
  }
  return 0;
}
