#include <bits/stdc++.h>
using namespace std;
const long long INF = 2147483647;
const long long INFL = 9223372036854775807LL;
const double EPSILON = 0.00000001;
const long long MOD = 1000000007;
struct stone {
  long long x, i, delta;
};
bool operator<(const stone& a, const stone& b) { return a.x < b.x; }
int32_t main() {
  long long n;
  cin >> n;
  vector<stone> cur;
  long long cur_sum = 0, target_sum = 0;
  for (long long i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    ;
    cur.push_back((stone){x, i, 0});
    cur_sum += x;
  }
  vector<long long> target;
  for (long long i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    ;
    target.push_back(x);
    target_sum += x;
  }
  sort(target.begin(), target.end());
  if (cur_sum != target_sum) {
    cout << "NO" << endl;
    return 0;
  }
  sort(cur.begin(), cur.end());
  vector<stone> negs, poss;
  for (long long i = 0; i < n; i++) {
    cur[i].delta = target[i] - cur[i].x;
    if (cur[i].delta > 0)
      poss.push_back(cur[i]);
    else if (cur[i].delta < 0)
      negs.push_back(cur[i]);
  }
  vector<vector<long long>> all_moves;
  long long i = 0, j = 0;
  for (; i < (long long)(poss).size(); i++) {
    while (poss[i].delta > 0 and j < (long long)(negs).size()) {
      long long d = ((poss[i].delta) < (-negs[j].delta) ? (poss[i].delta)
                                                        : (-negs[j].delta));
      if (d > (negs[j].x - poss[i].x) / 2) {
        cout << "NO" << endl;
        return 0;
      }
      poss[i].delta -= d;
      poss[i].x += d;
      negs[j].delta += d;
      negs[j].x -= d;
      vector<long long> mv = {poss[i].i, negs[j].i, d};
      all_moves.push_back(mv);
      if (negs[j].delta == 0) j++;
    }
  }
  for (long long i = 0; i < (long long)(poss).size(); i++) {
    if (poss[i].delta != 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (long long i = 0; i < (long long)(negs).size(); i++) {
    if (negs[i].delta != 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  cout << (long long)(all_moves).size() << endl;
  for (long long i = 0; i < (long long)(all_moves).size(); i++) {
    printf("%lld %lld %lld\n", all_moves[i][0] + 1, all_moves[i][1] + 1,
           all_moves[i][2]);
  }
  return 0;
}
