#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const U &b) {
  if (a < b) a = b;
}
pair<long long, int> p[303030];
long long t[303030];
struct data {
  int first, second;
  long long d;
  inline data(int first = 0, int second = 0, long long d = 0)
      : first(first), second(second), d(d) {}
};
vector<data> ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &p[i].first), p[i].second = i;
  for (int i = 1; i <= n; i++) scanf("%I64d", t + i);
  sort(p + 1, p + n + 1), sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; i++) p[i].first -= t[i];
  long long sum = 0;
  for (int i = 1; i <= n; i++) sum += p[i].first;
  if (sum) return puts("NO");
  for (int i = 1, j = 1; i <= n;) {
    for (; j <= n && p[j].first <= 0; j++)
      ;
    if (p[i].first == 0)
      i++;
    else if (p[i].first > 0)
      return puts("NO");
    else {
      if (j == n + 1) return puts("NO");
      long long mn = min(-p[i].first, p[j].first);
      ans.push_back(data(p[i].second, p[j].second, mn));
      p[i].first += mn, p[j].first -= mn;
      if (p[i].first) continue;
      i++;
    }
  }
  puts("YES");
  printf("%d\n", ans.size());
  for (data p : ans) printf("%d %d %I64d\n", p.first, p.second, p.d);
}
