#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> second[300005], t[300005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> second[i].first;
    second[i].second = i;
  }
  sort(second + 1, second + n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> t[i].first;
    t[i].second = i;
  }
  sort(t + 1, t + n + 1);
  queue<pair<pair<int, int>, int> > step;
  queue<pair<int, int> > cur;
  for (int i = 1; i <= n; i++) {
    if (second[i].first == t[i].first) continue;
    if (second[i].first < t[i].first) {
      cur.push({second[i].second, t[i].first - second[i].first});
    } else {
      int x = second[i].first - t[i].first;
      while (x && cur.size()) {
        pair<int, int> u = cur.front();
        cur.pop();
        int t = min(x, u.second);
        x -= t;
        u.second -= t;
        step.push({{second[i].second, u.first}, t});
        if (u.second > 0) cur.push(u);
      }
      if (x > 0) {
        cout << "NO";
        return 0;
      }
    }
  }
  if (cur.size()) {
    cout << "NO";
  } else {
    cout << "YES" << endl;
    cout << step.size() << endl;
    while (step.size()) {
      cout << step.front().first.second << " " << step.front().first.first
           << " " << step.front().second << endl;
      step.pop();
    }
  }
}
