#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
pair<int, int> vec[300000];
priority_queue<pair<int, int> > up, lo;
struct node {
  int u, v, d;
};
vector<node> ans;
pair<int, int> aa[300000];
int bb[300000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &aa[i].first);
    aa[i].second = i;
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) scanf("%d", &bb[i]);
  sort(aa, aa + n);
  sort(bb, bb + n);
  for (int i = 0; i < n; i++) {
    vec[i].first = bb[i] - aa[i].first;
    vec[i].second = aa[i].second;
    sum += vec[i].first;
    if (sum < 0) return !printf("NO\n");
    if (vec[i].first < 0) {
      vec[i].first *= -1;
      while (vec[i].first) {
        pair<int, int> u = lo.top();
        lo.pop();
        int k = min(u.first, vec[i].first);
        ans.push_back({u.second, vec[i].second, k});
        u.first -= k;
        vec[i].first -= k;
        if (u.first > 0) lo.push(u);
      }
    } else
      lo.push(vec[i]);
  }
  if (sum) return !printf("NO\n");
  printf("YES\n");
  printf("%d\n", (int)(ans).size());
  for (int i = 0; i < (int)(ans).size(); i++)
    printf("%d %d %d\n", ans[i].u + 1, ans[i].v + 1, ans[i].d);
}
