#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int dr8[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dc8[] = {1, -1, 0, 0, -1, 1, -1, 1};
int dr4[] = {0, 1, -1, 0};
int dc4[] = {1, 0, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int np = 0;
  vector<pair<long long int, long long int> > a(n), b(n);
  vector<int> ind(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].first;
    b[i].second = i;
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  for (int i = 0; i < n; i++) {
    ind[i] = a[i].second;
    a[i].second = i;
  }
  for (int i = 0; i < n; i++) {
    b[i].second = i;
  }
  vector<pair<pair<long long int, long long int>, long long int> > ans;
  long long int sm = 0;
  for (int i = 0; i < n; i++) {
    sm += b[i].first - a[i].first;
    if (sm < 0) {
      np = 1;
      break;
    }
  }
  if (np == 1 || sm != 0) {
    cout << "NO";
    return 0;
  } else {
    stack<pair<long long int, long long int> > st;
    long long int in = 1;
    st.push(make_pair(a[0].first, 0));
    while (in < n) {
      if ((b[in].first - a[in].first) == 0) {
        in++;
        continue;
      }
      long long int diff = b[in].first - a[in].first;
      if (diff < 0) {
        diff = -diff;
        while (diff > 0) {
          pair<long long int, long long int> p = st.top();
          st.pop();
          long long int mn = min(b[p.second].first - p.first, diff);
          mn = min(mn, (a[in].first - a[p.second].first) / 2);
          ans.push_back({{p.second, in}, mn});
          p.first += mn;
          diff -= mn;
          a[p.second].first = p.first;
          if (a[p.second].first != b[p.second].first) {
            st.push(make_pair(a[p.second].first, p.second));
          }
        }
        in++;
      } else {
        st.push(make_pair(a[in].first, a[in].second));
        in++;
      }
    }
  }
  cout << "YES\n" << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ind[ans[i].first.first] + 1 << " " << ind[ans[i].first.second] + 1
         << " " << ans[i].second << "\n";
  }
}
