#include <bits/stdc++.h>
using namespace std;
void pv(vector<long long int> arr, long long int size) {
  for (long long int i = 0; i < size; i++) {
    cout << arr[i] << ' ';
  }
}
void gv(vector<long long int> &arr) {
  long long int size = arr.size();
  for (long long int i = 0; i < size; i++) {
    cin >> arr[i];
  }
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int>> start(n), end(n);
  vector<long long int> disp(n);
  for (long long int i = 0; i < n; i++) {
    cin >> start[i].first;
    start[i].second = i;
  }
  sort(start.begin(), start.end());
  for (long long int i = 0; i < n; i++) {
    cin >> end[i].first;
    end[i].second = i;
  }
  sort(end.begin(), end.end());
  long long int cumu = 0;
  for (long long int i = 0; i < n; i++) {
    disp[i] = end[i].first - start[i].first;
    cumu += disp[i];
    if (cumu < 0) {
      cout << "NO";
      return 0;
    }
  }
  if (cumu != 0) {
    cout << "NO";
    return 0;
  }
  deque<pair<long long int, long long int>> d;
  vector<long long int> a, b, c;
  for (long long int i = 0; i < n; i++) {
    if (disp[i] > 0)
      d.push_back({i, start[i].second});
    else {
      while (disp[i] != 0) {
        long long int dd = min(disp[d.back().first], -disp[i]);
        disp[d.back().first] -= dd;
        disp[i] += dd;
        a.push_back(d.back().second);
        b.push_back(start[i].second);
        c.push_back(dd);
        if (disp[d.back().first] == 0) d.pop_back();
      }
    }
  }
  cout << "YES\n" << a.size() << '\n';
  for (long long int i = 0; i < a.size(); i++) {
    cout << a[i] + 1 << " " << b[i] + 1 << " " << c[i] << '\n';
  }
  return 0;
}
