#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
pair<int, int> s[N];
int t[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i].first;
    s[i].second = i + 1;
  }
  for (int i = 0; i < n; ++i) cin >> t[i];
  sort(s, s + n);
  sort(t, t + n);
  vector<pair<pair<int, int>, int>> ans;
  vector<pair<int, int>> st;
  for (int i = 0; i < n; ++i) {
    int d = s[i].first - t[i];
    if (d < 0) st.emplace_back(-d, s[i].second);
    while (d > 0 && st.size()) {
      pair<int, int> p = st.back();
      st.pop_back();
      int x = min(d, p.first);
      ans.emplace_back(pair<int, int>(p.second, s[i].second), x);
      d -= x;
      p.first -= x;
      if (p.first) st.push_back(p);
    }
    if (d > 0) {
      cout << "NO\n";
      return 0;
    }
  }
  if (st.size()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n" << ans.size() << '\n';
  for (auto p : ans)
    cout << p.first.first << ' ' << p.first.second << ' ' << p.second << '\n';
}
