#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int64_t n;
  cin >> n;
  int64_t s[n], t[n];
  for (int64_t i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int64_t i = 0; i < n; i++) {
    cin >> t[i];
  }
  vector<vector<int64_t>> ans;
  sort(t, t + n);
  int64_t p[n];
  iota(p, p + n, 0);
  sort(p, p + n, [&](int64_t a, int64_t b) { return s[a] < s[b]; });
  vector<int64_t> st;
  for (int64_t i = 0; i < n; i++) {
    if (s[p[i]] < t[i]) {
      st.push_back(i);
    } else {
      while (s[p[i]] > t[i]) {
        if (st.empty()) {
          cout << "NO" << endl;
          return 0;
        } else {
          int64_t d = min(t[st.back()] - s[p[st.back()]], s[p[i]] - t[i]);
          s[p[st.back()]] += d;
          s[p[i]] -= d;
          ans.push_back({p[st.back()] + 1, p[i] + 1, d});
          if (s[p[st.back()]] == t[st.back()]) {
            st.pop_back();
          }
        }
      }
    }
  }
  for (int64_t i = 0; i < n; i++) {
    if (s[p[i]] != t[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  cout << ans.size() << endl;
  for (auto it : ans) {
    for (auto jt : it) {
      cout << jt << ' ';
    }
    cout << "\n";
  }
  return 0;
}
