#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int b[N];
pair<int, int> a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  for (int i = 0; i < n; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + n);
  stack<pair<int, int> > st;
  vector<pair<pair<int, int>, int> > ans;
  for (int i = 0; i < n; i++) {
    int d = b[i] - a[i].first;
    while (d < 0) {
      if (st.empty()) return cout << "NO" << endl, 0;
      int r = min(-d, st.top().first);
      ans.push_back({{st.top().second, a[i].second}, r});
      d += r;
      st.top().first -= r;
      if (st.top().first == 0) st.pop();
    }
    if (d > 0) st.push({d, a[i].second});
  }
  if (st.size() != 0) return cout << "NO" << endl, 0;
  cout << "YES" << endl;
  cout << ans.size() << endl;
  for (auto x : ans)
    cout << x.first.first + 1 << " " << x.first.second + 1 << " " << x.second
         << endl;
  return 0;
}
