#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
using namespace std;
long long MOD = 998244353;
long long exp(long long n, long long e) {
  if (e == 0) return 1;
  long long temp = exp((n * n) % MOD, e / 2);
  return e % 2 == 0 ? temp : (temp * n) % MOD;
}
long long inverse(long long n) { return exp(n, MOD - 2); }
void frac(long long p, long long q) {
  cout << (p * inverse(q)) % MOD << endl;
  ;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a(n + 1), b(n + 1);
  vector<pair<int, int> > c(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    c[i] = pair<int, int>(a[i], i);
  }
  for (int i = 1; i <= n; i++) cin >> b[i];
  int l = 0, r = 0;
  sort(a.begin() + 1, a.end());
  sort(b.begin() + 1, b.end());
  sort(c.begin() + 1, c.end());
  vector<int> left, right;
  for (int i = 1; i <= n; i++) {
    if (a[i] < b[i]) right.push_back(i);
    if (a[i] > b[i]) left.push_back(i);
  }
  vector<pair<int, pair<int, int> > > ans;
  for (int i = 1; i <= n; i++) {
    if (a[i] > b[i]) {
      cout << "NO" << endl;
      return;
    }
    while (l < ((long long)(left).size()) && a[i] < b[i]) {
      int move = min(b[i] - a[i], a[left[l]] - b[left[l]]);
      ans.push_back(
          pair<int, pair<int, int> >(move, pair<int, int>(i, left[l])));
      a[i] += move;
      a[left[l]] -= move;
      if (a[left[l]] == b[left[l]]) l++;
    }
    if (a[i] < b[i]) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
  cout << ((long long)(ans).size()) << endl;
  for (int i = 0; i < ((long long)(ans).size()); i++)
    cout << c[ans[i].second.first].second << " "
         << c[ans[i].second.second].second << " " << ans[i].first << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
