#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int n, b[N];
pair<int, int> a[N];
vector<pair<pair<int, int>, int> > ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  long long s = 0;
  for (int i = 1; i <= n; i++) {
    s += b[i] - a[i].first;
    if (s < 0) {
      return cout << "NO", 0;
    }
  }
  vector<pair<int, int> > st;
  for (int i = 1; i <= n; i++) {
    if (b[i] - a[i].first > 0) {
      st.push_back(make_pair(b[i] - a[i].first, a[i].second));
    } else if (b[i] - a[i].first < 0) {
      if (st.empty()) {
        return cout << "NO", 0;
      }
      int cur = -(b[i] - a[i].first);
      while (!st.empty()) {
        int mn = min(st.back().first, cur);
        st.back().first -= mn;
        cur -= mn;
        ans.push_back(make_pair(make_pair(st.back().second, a[i].second), mn));
        if (st.back().first == 0) {
          st.pop_back();
        }
        if (cur == 0) {
          break;
        }
      }
      if (cur > 0) {
        return cout << "NO", 0;
      }
    }
  }
  if (!st.empty()) {
    return cout << "NO", 0;
  }
  cout << "YES\n";
  cout << (int)ans.size() << "\n";
  for (auto it : ans) {
    cout << it.first.first << " " << it.first.second << " " << it.second
         << "\n";
  }
}
