#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = (int)1e5 + 1;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  pair<long long, long long> a[n];
  long long b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  sort(a, a + n);
  sort(b, b + n);
  long long suma = 0;
  long long sumb = 0;
  for (int i = 0; i < n; i++) {
    suma += a[i].first;
    sumb += b[i];
    if (suma > sumb) {
      cout << "NO";
      return 0;
    }
  }
  if (suma != sumb) {
    cout << "NO";
    return 0;
  }
  cout << "YES"
       << "\n";
  vector<long long> ans;
  vector<pair<long long, int>> can;
  for (int i = 0; i < n; i++) {
    int dif = b[i] - a[i].first;
    if (dif > 0) {
      can.push_back({dif, i});
      continue;
    }
    if (dif == 0) {
      continue;
    }
    if (dif < 0) {
      int need = (-1) * dif;
      while (need != 0) {
        if (need >= (can.back()).first) {
          need -= (can.back()).first;
          ans.push_back(a[(can.back()).second].second);
          ans.push_back(a[i].second);
          ans.push_back((can.back()).first);
          can.pop_back();
        } else {
          ans.push_back(a[(can.back()).second].second);
          ans.push_back(a[i].second);
          ans.push_back(need);
          (can.back()).first -= need;
          need = 0;
        }
      }
    }
  }
  cout << ans.size() / 3 << "\n";
  int it = 0;
  for (auto i : ans) {
    cout << i << " ";
    it++;
    if (it == 3) {
      cout << "\n";
      it = 0;
    }
  }
  return 0;
}
