#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int>> S;
  S.reserve(n);
  for (int i = 0; i < n; ++i) {
    int s;
    cin >> s;
    S.emplace_back(s, i);
  }
  vector<int> T;
  T.reserve(n);
  copy_n(istream_iterator<int>(cin), n, back_inserter(T));
  sort(S.begin(), S.end());
  sort(T.begin(), T.end());
  vector<pair<int, int>> d;
  d.reserve(n);
  for (int i = 0; i < n; ++i) {
    d.emplace_back(T[i] - S[i].first, S[i].second);
  }
  long long tot = 0;
  for (auto x : d) {
    tot += x.first;
  }
  auto ok = (tot == 0ll);
  vector<pair<pair<int, int>, int>> ans;
  if (ok) {
    int ni = 0;
    for (int i = 0; i < n; ++i) {
      auto &di = d[i].first;
      if (di < 0) {
        ok = 0;
        break;
      }
      if (di == 0) {
        continue;
      }
      while (di) {
        ni = max(ni, i + 1);
        while (ni < n && d[ni].first >= 0) {
          ++ni;
        }
        if (ni == n) {
          ok = 0;
          break;
        }
        auto &dni = d[ni].first;
        int q = min(di, -dni);
        di -= q;
        dni += q;
        ans.emplace_back(make_pair(d[i].second, d[ni].second), q);
      }
    }
    for (auto x : d) {
      if (x.first) {
        ok = 0;
        break;
      }
    }
  }
  if (ok) {
    cout << "YES\n" << ans.size() << '\n';
    for (auto &abd : ans) {
      cout << abd.first.first + 1 << ' ' << abd.first.second + 1 << ' '
           << abd.second << '\n';
    }
  } else {
    cout << "NO";
  }
  cout << endl;
  return 0;
}
