#include <bits/stdc++.h>
using namespace std;
const int n = 3e5 + 5;
int N;
int Z[n], T[n];
pair<int, int> S[n];
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int s;
    cin >> s;
    S[i] = {s, i};
  }
  for (int i = 0; i < N; ++i) {
    cin >> T[i];
  }
  sort(S, S + N);
  sort(T, T + N);
  priority_queue<pair<int, int>> qR;
  priority_queue<pair<int, int>> qL;
  for (int i = 0; i < N; ++i) {
    Z[S[i].second] = T[i];
    if (T[i] > S[i].first)
      qL.push({S[i].first, S[i].second});
    else if (T[i] < S[i].first)
      qR.push({S[i].first, S[i].second});
  }
  vector<tuple<int, int, int>> v;
  while (!qL.empty() && !qR.empty()) {
    int il, ir, pl, pr;
    tie(pl, il) = qL.top();
    tie(pr, ir) = qR.top();
    qL.pop();
    qR.pop();
    int dl = Z[il] - pl;
    int dr = pr - Z[ir];
    if (dl < 0 || dr < 0 || (dr + dl > pr - pl)) {
      cout << "NO\n";
      return 0;
    }
    v.push_back({il, ir, min(dl, dr)});
    if (dl < dr) {
      qR.push({pr - dl, ir});
    } else if (dr < dl) {
      qL.push({pl + dr, il});
    }
  }
  if (!qL.empty() || !qR.empty()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  cout << v.size() << endl;
  for (auto t : v) {
    int i, j, d;
    tie(i, j, d) = t;
    cout << i + 1 << " " << j + 1 << " " << d << "\n";
  }
  return 0;
}
