#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 3e5 + 10;
const long long MOD = 1e9 + 9;
const long long M1 = 1e18 + 3, M2 = 1e9 + 7;
const long long p1 = 197, p2 = 229;
const int rx[4] = {-1, 0, 1, 0};
const int ry[4] = {0, 1, 0, -1};
const int hx[8] = {-2, -2, -1, 1, 2, 2, 1, -1};
const int hy[8] = {-1, 1, 2, 2, 1, -1, -2, -2};
const long double eps = 1e-7;
const long double pi = acos(-1.0);
const long long INF = 1e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  pair<long long, long long> 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, s + n);
  sort(t, t + n);
  long long need[n];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    need[i] = t[i].first - s[i].first;
    sum += need[i];
    if (sum < 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (sum != 0 || need[0] < 0 || need[n - 1] > 0) {
    cout << "NO" << endl;
    return 0;
  }
  vector<pair<pair<long long, long long>, long long> > ans;
  vector<pair<int, int> > st;
  for (int i = 0; i < n; i++) {
    if (need[i] > 0) {
      st.push_back({need[i], i});
    } else {
      while (!st.empty() && st.back().first <= abs(need[i])) {
        ans.push_back(
            {{s[st.back().second].second, s[i].second}, st.back().first});
        need[i] += st.back().first;
        st.pop_back();
      }
      if (!st.empty()) {
        if (need[i] < 0) {
          ans.push_back(
              {{s[st.back().second].second, s[i].second}, abs(need[i])});
        }
        st.back().first += need[i];
      }
    }
  }
  cout << "YES" << endl;
  cout << ans.size() << endl;
  for (auto it : ans) {
    cout << it.first.first + 1 << " " << it.first.second + 1 << " " << it.second
         << endl;
  }
  return 0;
}
