#include <bits/stdc++.h>
using namespace std;
const long long N = 800500;
long long n;
long long s[N], t[N];
bool f(const long long &a, const long long &b) { return s[a] < s[b]; }
vector<pair<pair<long long, long long>, long long>> wyn;
void ruch(long long a, long long b, long long c) {
  if (c == 0) return;
  if (s[b] < s[a]) swap(a, b);
  wyn.push_back(make_pair(make_pair(a, b), c));
  s[a] += c;
  s[b] -= c;
}
vector<long long> kamienie;
set<pair<long long, long long>> se;
void solve() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> s[i];
    kamienie.push_back(i);
  }
  for (long long i = 0; i < n; i++) {
    cin >> t[i];
  }
  sort(kamienie.begin(), kamienie.end(), f);
  sort(t, t + n);
  for (long long i = 0; i < n; i++) {
    long long k = kamienie[i];
    long long pozk = t[i];
    if (pozk == s[k]) continue;
    if (pozk > s[k]) {
      se.insert(make_pair(k, pozk - s[k]));
    } else {
      while (pozk != s[k]) {
        if (se.size() == 0) {
          cout << "NO";
          return;
        }
        auto pom = *(se.begin());
        long long ile = min(s[k] - pozk, pom.second);
        ruch(k, pom.first, ile);
        se.erase(pom);
        if (pom.second != ile)
          se.insert(make_pair(pom.first, pom.second - ile));
      }
    }
  }
  if (se.size() != 0) {
    cout << "NO";
    return;
  }
  cout << "YES\n";
  cout << wyn.size() << "\n";
  for (auto it : wyn) {
    cout << it.first.first << " " << it.first.second << " " << it.second
         << "\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
