#include <bits/stdc++.h>
using namespace std;
int s[300005];
int t[300005];
int l[300005];
int b[300005];
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > vec;
  for (int i = 1; i <= n; i++) {
    scanf("%d", s + i);
    vec.emplace_back(s[i], i);
  }
  sort(vec.begin(), vec.end());
  for (int i = 1; i <= n; i++) {
    scanf("%d", t + i);
  }
  sort(s + 1, s + n + 1);
  for (int i = 1; i <= n; i++) {
    b[i] = vec[i - 1].second;
  }
  sort(t + 1, t + n + 1);
  long long sum = 0ll;
  queue<int> q;
  vector<tuple<int, int, int> > out;
  for (int i = 1; i <= n; i++) {
    int cur = t[i] - s[i];
    if (cur < 0) {
      if (q.empty()) {
        printf("NO\n");
        return 0;
      }
      int tg = -cur;
      while (!q.empty() && tg > 0) {
        if (l[q.front()] == 0) {
          q.pop();
        } else if (l[q.front()] > tg) {
          l[q.front()] -= tg;
          out.emplace_back(q.front(), i, tg);
          tg = 0;
          break;
        } else {
          tg -= l[q.front()];
          out.emplace_back(q.front(), i, l[q.front()]);
          l[q.front()] = 0;
          q.pop();
        }
      }
      if (tg != 0) {
        printf("NO\n");
        return 0;
      }
    } else {
      l[i] = cur;
      q.push(i);
    }
    sum += (long long)cur;
    if (sum < 0ll) {
      printf("NO\n");
      return 0;
    }
  }
  while (!q.empty() && l[q.front()] == 0) q.pop();
  if (sum != 0ll || !q.empty()) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  printf("%d\n", out.size());
  for (auto p : out) {
    printf("%d %d %d\n", b[get<0>(p)], b[get<1>(p)], get<2>(p));
  }
  return 0;
}
