#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (auto i = begin(v); i != end(v); i++)
    os << *i << (i == end(v) - 1 ? "" : " ");
  return os;
}
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto i = begin(v); i != end(v); i++) is >> *i;
  return is;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int>> s(n), t(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i].first;
    s[i].second = i;
  }
  for (int i = 0; i < n; i++) {
    cin >> t[i].first;
    t[i].second = i;
  }
  sort((s).begin(), (s).end());
  sort((t).begin(), (t).end());
  long long acc_diff = 0;
  vector<pair<int, int>> to_take;
  vector<pair<pair<int, int>, int>> ans;
  for (int i = 0; i < n; i++) {
    long long ofs = t[i].first - s[i].first;
    if (ofs == 0) continue;
    acc_diff += ofs;
    if (acc_diff < 0) {
      cout << "NO";
      return 0;
    }
    if (ofs > 0)
      to_take.emplace_back(s[i].second, ofs);
    else {
      while (ofs < 0) {
        int take = min(-(int)ofs, to_take.back().second);
        ofs += take;
        to_take.back().second -= take;
        ans.push_back({{to_take.back().first, s[i].second}, take});
        if (to_take.back().second == 0) to_take.pop_back();
      }
    }
  }
  if (acc_diff != 0) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n" << ans.size() << "\n";
  for (auto x : ans) {
    cout << x.first.first + 1 << " " << x.first.second + 1 << " " << x.second
         << "\n";
  }
  return 0;
}
