#include <bits/stdc++.h>
using namespace std;
const int maxx = 5e6 + 1314;
int top, n;
int topx;
int x[maxx], y[maxx], k[maxx];
int read() {
  int k;
  scanf("%d", &k);
  return k;
}
int t[maxx], s[maxx];
int A[maxx];
struct XX {
  int id, v;
} C[maxx];
void init(int X, int Y, int K) {
  x[++topx] = C[X].id;
  y[topx] = C[Y].id;
  k[topx] = K;
  A[x[topx]] += K;
  A[y[topx]] -= K;
}
bool my(XX a, XX b) { return a.v < b.v; }
pair<int, int> stk[maxx];
int main() {
  n = read();
  for (int i = 1; i <= n; i++)
    s[i] = read(), C[i].v = s[i], C[i].id = i, A[i] = s[i];
  for (int i = 1; i <= n; i++) t[i] = read();
  sort(C + 1, C + 1 + n, my);
  sort(s + 1, s + 1 + n);
  sort(t + 1, t + 1 + n);
  for (int i = 1; i <= n; i++) {
    if (s[i] == t[i]) continue;
    if (s[i] < t[i]) {
      stk[++top] = make_pair(t[i] - s[i], i);
    }
    if (s[i] > t[i]) {
      int val = s[i] - t[i];
      while (top && val) {
        pair<int, int> T = stk[top];
        if (T.first > val)
          stk[top].first -= val, init(T.second, i, val), val = 0;
        else
          top--, val -= T.first, init(T.second, i, T.first);
      }
      if (!top && val) {
        puts("NO");
        return 0;
      }
    }
  }
  if (top) {
    puts("NO");
    return 0;
  }
  puts("YES");
  cout << topx << endl;
  for (int i = 1; i <= topx; i++)
    cout << x[i] << " " << y[i] << " " << k[i] << endl;
  return 0;
}
