#include <bits/stdc++.h>
using namespace std;
int m, n, k;
long long t[300001];
pair<long long, int> s[300001];
vector<pair<int, long long> > st;
vector<pair<pair<int, int>, long long> > ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i].first;
    s[i].second = i;
  }
  for (int i = 1; i <= n; i++) cin >> t[i];
  sort(t + 1, t + n + 1);
  sort(s + 1, s + n + 1);
  long long sum = 0;
  for (int i = 1; i <= n; i++)
    if (t[i] != s[i].first) {
      if (t[i] > s[i].first) {
        st.push_back({s[i].second, t[i] - s[i].first});
        sum += t[i] - s[i].first;
      } else {
        if (s[i].first - t[i] > sum) {
          cout << "NO";
          return 0;
        }
        while (!st.empty()) {
          long long mn = min(st.back().second, s[i].first - t[i]);
          ans.push_back({{st.back().first, s[i].second}, mn});
          st.back().second -= mn;
          s[i].first -= mn;
          sum -= mn;
          if (st.back().second == 0)
            st.pop_back();
          else
            break;
        }
      }
    }
  if (!st.empty()) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  cout << ans.size() << '\n';
  for (auto x : ans) {
    cout << x.first.first << ' ' << x.first.second << ' ' << x.second << '\n';
  }
  return 0;
}
