#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const long long MOD = 1234567891;
int i, j, k, m, n, l;
const int N = 300001;
long long ans;
long long s[N], t[N];
vector<pair<pair<long long, long long>, int>> v;
void solve() {
  v.clear();
  set<pair<long long, long long>> S;
  sort(t, t + n);
  for (int i = 0; i < n; i++) S.insert(pair<long long, long long>(s[i], i + 1));
  for (int i = 0; i < n; i++) {
    pair<long long, long long> p = *S.begin();
    if (p.first > t[i]) {
      cout << "NO" << endl;
      return;
    }
    set<pair<long long, long long>>::iterator it2 =
        S.upper_bound(pair<long long, long long>(t[i], n + 5));
    set<pair<long long, long long>>::iterator it1 = it2;
    it1--;
    if (it1->first == t[i]) {
      S.erase(it1);
      continue;
    }
    if (it2 == S.end()) {
      cout << "NO" << endl;
      return;
    }
    long long z = min(it2->first - t[i], t[i] - it1->first);
    v.push_back(
        make_pair(pair<long long, long long>(it1->second, it2->second), z));
    pair<long long, long long> p2 = *it2;
    pair<long long, long long> p1 = *it1;
    S.erase(p1);
    S.erase(p2);
    p1.first += z;
    p2.first -= z;
    if (p1.first == t[i])
      S.insert(p2);
    else
      S.insert(p1);
  }
  cout << "YES" << endl;
  cout << ((int)v.size()) << endl;
  for (int i = 0; i < ((int)v.size()); i++) {
    printf("%lld %lld %d\n", v[i].first.first, v[i].first.second, v[i].second);
  }
}
void check() {}
int main() {
  while (cin >> n) {
    for (int i = 0; i < n; i++) scanf("%d", &s[i]);
    for (int i = 0; i < n; i++) scanf("%d", &t[i]);
    solve();
  }
  return 0;
}
