#include <bits/stdc++.h>
using namespace std;
const long long N = 333333;
pair<long long, long long> a[N];
long long b[N];
long long n;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = (1); i <= (n); i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  for (long long i = (1); i <= (n); i++) {
    cin >> b[i];
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  vector<tuple<long long, long long, long long> > ans;
  long long j = 1;
  for (long long i = (1); i <= (n); i++) {
    if (a[i].first == b[i]) continue;
    if (a[i].first > b[i]) {
      cout << "NO"
           << "\n";
      return 0;
    }
    while (a[i].first < b[i]) {
      while (j <= n && a[j].first <= b[j]) {
        j++;
      }
      if (j > n) {
        cout << "NO"
             << "\n";
        return 0;
      }
      long long can = min(b[i] - a[i].first, a[j].first - b[j]);
      can = min(can, a[j].first - a[i].first >> 1);
      if (can > 0) {
        ans.push_back(make_tuple(a[i].second, a[j].second, can));
        a[i].first += can;
        a[j].first -= can;
      }
    }
    if (a[i].first < b[i]) {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  cout << "YES"
       << "\n"
       << (long long)(ans).size() << "\n";
  for (auto t : ans) {
    cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << "\n";
  }
  return 0;
}
