#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
inline int read() {
  int s = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) s = s * 10 + ch - '0', ch = getchar();
  return s * f;
}
int n, m;
pair<int, int> s[N];
int t[N];
int ans[N * 5][3];
deque<pair<pair<int, int>, int> > q;
int main() {
  n = read();
  for (int i = 1; i <= n; i++) s[i].first = read(), s[i].second = i;
  for (int i = 1; i <= n; i++) t[i] = read();
  sort(s + 1, s + n + 1);
  sort(t + 1, t + n + 1);
  int res = 0;
  for (int i = 1; i <= n; i++) {
    int num = s[i].first - t[i];
    if (num < 0)
      q.push_back({s[i], -num});
    else {
      while (num != 0 && !q.empty()) {
        pair<int, int> u = q.front().first;
        int cnt = q.front().second;
        q.pop_front();
        res++;
        ans[res][0] = u.second, ans[res][1] = s[i].second;
        if (cnt > num) {
          u.first += num;
          q.push_front({u, cnt - num});
          ans[res][2] = num;
          num = 0;
          break;
        } else {
          num -= cnt;
          ans[res][2] = cnt;
        }
      }
      if (num != 0) {
        puts("NO");
        return 0;
      }
    }
  }
  if (!q.empty()) {
    puts("NO");
    return 0;
  }
  puts("YES");
  printf("%d\n", res);
  for (int i = 1; i <= res; i++)
    printf("%d %d %d\n", ans[i][0], ans[i][1], ans[i][2]);
  return 0;
}
