#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
const double PI = acos(-1);
const double eps = (1e-9);
const long long int INF = 2e9;
const int N = (2e6) + 3;
tuple<int, int, int> ans[N];
void solve() {
  int m = 0;
  int n, a, i, d, s, r, b;
  scanf("%d", &n);
  vector<pair<int, int> > v(n);
  vector<int> ar(n);
  for (i = 0; i < n; ++i) scanf("%d", &a), v[i] = {a, i};
  for (i = 0; i < n; i++) scanf("%d", &ar[i]);
  sort(v.begin(), v.end());
  sort(ar.begin(), ar.end());
  long long int sum = 0;
  for (i = 0; i < n; ++i) {
    d = ar[i] - v[i].first;
    sum += d;
    if (sum < 0) printf("NO\n"), exit(0);
  }
  if (sum != 0) printf("NO\n"), exit(0);
  stack<pair<int, int> > st;
  pair<int, int> temp;
  for (i = 0; i < n; ++i) {
    d = ar[i] - v[i].first;
    if (d > 0) st.push({v[i].second, d});
    while (d < 0) {
      tie(a, r) = st.top();
      st.pop();
      s = min(r, -d), d += s, r -= s;
      ans[m++] = make_tuple(a, v[i].second, s);
      if (r > 0) st.push({a, r});
    }
  }
  printf("YES\n");
  printf("%d\n", m);
  for (i = 0; i < m; ++i)
    tie(a, b, d) = ans[i], printf("%d %d %d\n", a + 1, b + 1, d);
}
int main() {
  int t = 1;
  while (t--) solve();
}
